checkbox 全选和全不选
1 jsp页面
<input id="selectCheckBoxAllChk" type="checkbox">
2 js
//绑定复选框全选事件
$("#selectCheckBoxAllChk").bind("click",function(){
if($(this).prop("checked")){
$("input[type='checkbox']").prop("checked", 'true');
}else{
$("input[type='checkbox']").removeAttr("checked");
}
});
注:需要引入jquery.js以上版本
如果不学习,活着干什么