<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title></title>
<script type="text/javascript" src="js/jquery-1.11.3.js" ></script>
<script>
/* $(function(){
$("#selectall").click(function(){
$("input").prop("checked",this.checked);
})
}) */
$(function(){
$("#selectall").click(function(){
$(".selectaaa").prop('checked',$(this).prop('checked'))
})
$(".selectaaa").click(function(){
var isAllChecked = true;
$(".selectaaa").each(function(){
if($(this).prop('checked')==false){
isAllChecked=false
}
})
$("#selectall").prop("checked",isAllChecked)
})
});
</script>
</head>
<body>
<input type="checkbox" name="" id="selectall"/><br>
<input type="checkbox" name="" id="" class="selectaaa"/><br>
<input type="checkbox" name="" id="" class="selectaaa"/><br>
<input type="checkbox" name="" id="" class="selectaaa"/><br>
</body>
</html>