html代码:
<input type="checkbox" id="checkAll"/>全选
<div>
<input type="checkbox" name="checkbox"/>
<input type="checkbox" name="checkbox"/>
<input type="checkbox" name="checkbox"/>
<input type="checkbox" name="checkbox"/>
<input type="checkbox" name="checkbox"/>
<input type="checkbox" name="checkbox"/>
</div>
jquery代码:
$('#checkAll').live('click',function(){ // 全选
$('input[name="checkBox"]').prop("checked", this.checked);
});
ok了,太实用了!!