Given the following repeated markup in a page:
<div>
<input type="checkbox" id="chk1" />
<div id="div1" >
//stuff to toggle
</div>
</div>
<div>
<input type="checkbox" id="chk2" />
<div id="div2" >
//stuff to toggle
</div>
</div>
如何获得所有检查箱,然后在每次检查箱的笔记中,积极增加有关 d的角子?
$(document).ready(function() {
$( input:checkbox ).each(
function() {
$(this).bind( click", function() {
//Attach toggle() to associate DIV
//$( #div1 ).toggle();
});
});
});
如果不采用按规定分类或假设已订购的身份证清单,这样做是否简单?