<input id="all" type='checkbox' />
<input type='checkbox' value='1’ name="mailId"/>
<input type='checkbox' value='2‘ name="mailId"/>
<input type='checkbox' value='3‘ name="mailId"/>
js中
$(document).ready(function(){
//全选、全不选
$("#all").click(function(){
if(this.checked){
$("input[name='mailId']").prop("checked", true);
}else{
$("input[name='mailId']").prop("checked", false);
}
});
})