Hii
This will help! :)
<div id="checkBoxDiv">
<input type="checkbox" class="chkSiteBox" onclick="selectAllCheckBoxs(this,'checkBoxDiv')" value="1" id="chkBox1" name="_chkBox1">
<input type="checkbox" class="chkSiteBox" onclick="selectAllCheckBoxs(this,'checkBoxDiv')" value="1" id="chkBox2" name="_chkBox2">
<input type="checkbox" class="chkSiteBox" onclick="selectAllCheckBoxs(this,'checkBoxDiv')" value="1" id="chkBox3" name="_chkBox3">
<input type="checkbox" class="chkSiteBox" onclick="selectAllCheckBoxs(this,'checkBoxDiv')" value="1" id="chkBox4" name="_chkBox4">
</div>
Then js code:
function selectAllCheckBoxs(tis,id) {
$('#'+id).find('input[type="checkbox"]').each(function(i){
if($(tis).attr("checked")) {
$(this).attr("checked", true);
} else {
$(this).attr("checked", false);
}
});
}