my requirement is while select the check all , all the check box should be selected, and if any one check box is unchecked then checkAll should be unchecked. first part is working fine i getting problem in second part.
function registerCheckBox() {
/// this part is working fine
$("#selectall").off("click");
$("#selectall").on("click", function(){
if($(this).prop('checked')){
$(".notificationSentChk").attr("checked", true);
}else{
$(".notificationSentChk").attr("checked", false);
}
} );
// getting problem here :
$(".notificationSentChk").off("click");
$(".notificationSentChk").on("click", function(){
if($(this).prop('checked')==false){
$("#selectall").attr("checked", false);
}
} );
}