【发布时间】:2011-09-03 23:52:23
【问题描述】:
我有一个类似这样的 DOM 结构(我不想显示其他 td,因为人满为患):
<table>
<tr><td><input type="checkbox" name="checkbox1" class="rowSelectCheckbox"></td></input></tr>
<tr><td><input type="checkbox" name="checkbox2" class="rowSelectCheckbox"></td></input></tr>
<tr><td><input type="checkbox" name="checkbox3" class="rowSelectCheckbox"></td></input></tr>
<tr><td><input type="checkbox" name="checkbox4" class="rowSelectCheckbox"></td></input></tr>
</table>
<input type="checkbox" name="checkbox_select" id="lastCheckbox"></input>
我正在尝试做的是设置最后一个具有 lastCheckbox id 的复选框以检查是否选中了 任何 其他复选框(任何具有 checkbox1、checkbox 2 等 id 的复选框) , 否则如果 所有 其他复选框都未选中,则将最后一个复选框也设置为未选中。
【问题讨论】: