我希望通过选项标题(在粗体标签内)定位选择框,代码是动态生成的,我知道的唯一不变的是选项标题:(在粗体标签内)如何我可以在jquery
中定位<div id="option-264" class="option">
<span class="required">*</span>
<b>Board Type:</b><br />
<select name="option[264]" class="optionChoice">
<option value=""> --- Please Select --- </option>
<option value="20">All Mountain </option>
<option value="21">Straight Jibber </option>
<option value="22">Bender </option>
<option value="23">Tripod </option>
</select>
</div>
<br />
<div id="option-265" class="option">
<span class="required">*</span>
<b>Board Size:</b><br />
<select name="option[265]" class="optionChoice">
<option value=""> --- Please Select --- </option>
<option value="17">146 </option>
<option value="18">147 </option>
<option value="19">149 </option>
<option value="24">150 </option>
<option value="25">152 </option>
<option value="26">153 </option>
<option value="27">155 </option>
<option value="28">156 </option>
<option value="29">157 </option>
<option value="30">158 </option>
<option value="31">159 </option>
</select>
</div>
答案 0 :(得分:1)
按标题,是指电路板尺寸,电路板类型等?应该可以使用:contains()
来完成$(".option:contains('title')").find('select')