提供一个思路既然是树,应该是类似下面这种结构吧<div>
<div><input type=checkbox id=A>A组</div>
<div>
<div> </div><div><intput type=checkbox>A</div>
<div> </div><div><intput type=checkbox>B</div>
</div>
</div>类似上面这种结构,点击A组的checkbox,可以使用下面步骤访问A的checkboxA.parentNode.nextSibling.children[1].children[0];
<div><input type=checkbox id=A>A组</div>
<div>
<div> </div><div><intput type=checkbox>A</div>
<div> </div><div><intput type=checkbox>B</div>
</div>
</div>类似上面这种结构,点击A组的checkbox,可以使用下面步骤访问A的checkboxA.parentNode.nextSibling.children[1].children[0];
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货