$("th").on(‘click‘,‘#checkboxHead‘,function(){
???var temp= $("#checkboxHead").is(‘:checked‘);
?// ?alert(temp);
???if(temp==true){
??????//alert("选中");
???????$("td input[type=‘checkbox‘]").each(function(){
?????????// ?复选框打勾
???????????$(this).prop("checked",true);
???????});
???}
???else
???{ ?// ?复选框取消打勾
???????$("td input[type=‘checkbox‘]").each(function(){
???????????$(this).removeAttr("checked");
??????????// $(this).attr("checked",false);
???????});
???}
});
jquery 复选框全选与取消选中
原文地址:http://www.cnblogs.com/yanglife/p/7639869.html