function checkall(){
var allCheck = $("#allboxs").is("checked");// 取得全选checkbox是否被选中,如果选中为true,未选中为false
if(allCheck){
var nameboxs = $("input[name^='boxs']");// 获取name值为boxs的所有input
for(i=0; i<nameboxs.length; i++){
nameboxs[i].checked = true;// 将第i个checkbox选中
}
}
if(!allCheck){
var nameboxs = $("input[name^='boxs']");// 获取name为boxs的input
for(i=0; i<nameboxs.length; i++){
nameboxs[i].checked = false;// 将第i个checkbox不选中
}
}
}