【发布时间】:2014-05-15 14:08:10
【问题描述】:
我有以下与 Oracle APEX 中的复选框组相关的 HTML 代码:
<fieldset class="checkbox_group" id="P300_CELL_TECH" tabindex="-1" disabled="disabled">
<legend class="hideMeButHearMe">
<div id="cell-filter">
<div style="font-size:10px;margin-left:-11px;">Select All</div>
<input type="checkbox" checked="" name="select-all-cell" id="select-all-cell" disabled="disabled"/>
<div class="cb-filter-label">Cells</div>
</div>
<hr>
</legend>
<table class="checkbox_group" role="presentation" summary="">
<tbody>
<tr>
<td>
<input type="checkbox" value="0" name="p_v42" id="P300_CELL_TECH_0">
<label for="P300_CELL_TECH_0">0</label>
</td>
<td>
<input type="checkbox" value="1" name="p_v42" id="P300_CELL_TECH_1">
<label for="P300_CELL_TECH_1">1</label>
</td>
<td>
<input type="checkbox" value="2" name="p_v42" id="P300_CELL_TECH_2">
<label for="P300_CELL_TECH_2">2</label>
</td>
<td>
<input type="checkbox" value="3" name="p_v42" id="P300_CELL_TECH_3">
<label for="P300_CELL_TECH_3">3</label>
</td>
<td>
<input type="checkbox" value="4" name="p_v42" id="P300_CELL_TECH_4">
<label for="P300_CELL_TECH_4">4</label>
</td>
<td>
<input type="checkbox" value="5" name="p_v42" id="P300_CELL_TECH_5">
<label for="P300_CELL_TECH_5">5</label>
</td>
</tr>
</tbody>
</table>
</fieldset>
使用 jQuery,我如何遍历所有这些输入复选框类型并将所有这些复选框设置为选中,而不使用 name="p_v42"(因为名称可以更改)并且不知道此字段集中的确切复选框数量可能会有所不同?
我正在寻找一个只关注每个<input type="checkbox" ...> 的答案。
我在同一页面上还有其他复选框,但不想针对那些,只是上面描述的那些。
顶级 id 永远是:
id="P300_CELL_TECH"
【问题讨论】:
-
在 Google 上快速搜索:api.jquery.com/attribute-starts-with-selector
标签: jquery checkbox oracle-apex