$(function(){
//点击全选控制item checkbox是否选中
$("#allschool").bind("click",function(){
var ischecked = $("input[name='allschool']").attr("checked");
$("[name=schoolids]:checkbox").each(function(){
if(ischecked == 'checked')
{
$(this).attr("checked",true);
}else{
$(this).attr("checked",false);
}
});
});
//根据item checkbox控制是否全选
$("[name=schoolids]:checkbox").bind("click",function(){
var chk = $("[name=schoolids]:checkbox");
$("#allschool").attr("checked",chk.length == chk.filter(":checked").length);
});
});