復(fù)選框全選?
$("#checkAll").click(function() {
? ? $('input[name="child"]').prop("checked",this.checked);
? ? ? ?// 把父級的checked的屬性傳給子集
});
? ? var $child = $("input[name='child']");
? ? ?$child.click(function(){
? ? ? ? ? ? ? ? $("#checkAll").prop("checked",$child.length == $("input[name='child']:checked").length ? true : false);
? ? ? ? ? ? ? ?//判斷子集復(fù)選框lenght的長度是否=子集以選中復(fù)選框的長度 ?是為true 不是為falsefalse
? ? ? });