allcheck is the select all checkbox, checkid is all other checkboxes. According to the Internet, jQuery1.6 and above all use prop, and the second time using attr will be invalid.
$("#allcheck").click(function(){
if($("input[name=allcheck]").prop("checked")){//Determine whether it is selected
$("input[name=allcheck]").prop("checked", true);//选中
$("input[name=checkid]").prop("checked", true);//选中
}else{
$("input[name=allcheck]").prop("checked", false);//取消选中
$("input[name=checkid]").prop("checked", false);//
}
})