日期:2014-05-16 浏览次数:20498 次
<table>
<tr id="node-1">
<td>总类一</td>
<td><input class="inputcheckbox" type="checkbox" name="ids[1][1]"/> 选项1
<td><input class="inputcheckbox" type="checkbox" name="ids[1][2]"/> 选项2
<td><input class="inputcheckbox" type="checkbox" name="ids[1][3]"/> 选项3
<tr id="node-10" class="child-of-node-1">
<td>总类一 分类一</td>
<td><input class="inputcheckbox" type="checkbox" name="ids[10][1]"/> 选项1
<td><input class="inputcheckbox" type="checkbox" name="ids[10][2]"/> 选项2
<td><input class="inputcheckbox" type="checkbox" name="ids[10][3]"/> 选项3
<tr id="node-11" class="child-of-node-1">
<td>总类一 分类二</td>
<td><input class="inputcheckbox" type="checkbox" name="ids[11][1]"/> 选项1
<td><input class="inputcheckbox" type="checkbox" name="ids[11][2]"/> 选项2
<td><input class="inputcheckbox" type="checkbox" name="ids[11][3]"/> 选项3
<tr id="node-2">
<td>总类二</td>
<td><input class="inputcheckbox" type="checkbox" name="ids[2][1]"/> 选项1
<td><input class="inputcheckbox" type="checkbox" name="ids[2][2]"/> 选项2
<td><input class="inputcheckbox" type="checkbox" name="ids[2][3]"/> 选项3
<tr id="node-20" class="child-of-node-2">
<td>总类二 分类一</td>
<td><input class="inputcheckbox" type="checkbox" name="ids[20][1]"/> 选项1
<td><input class="inputcheckbox" type="checkbox" name="ids[20][2]"/> 选项2
<td><input class="inputcheckbox" type="checkbox" name="ids[20][3]"/> 选项3
<tr id="node-3">
<td>总类二</td>
<td><input class="inputcheckbox" type="checkbox" name="ids[3][1]"/> 选项1
<td><input class="inputcheckbox" type="checkbox" name="ids[3][2]"/> 选项2
<td><input class="inputcheckbox" type="checkbox" name="ids[3][3]"/> 选项3
</table>
<script type="text/javascript">
function getElementsByClassName(className, element) {
var children = (element
------解决方案--------------------
document).getElementsByTagName('*');
var elem