Demo of Managing group of checkboxes from a single checkbox


One
Two
Three
Four

Five

Check and uncheck the checkbox Five to managee all other checkboxes.

JQuery

<script>
$(document).ready(function() {
$('#ckb5').change(function(){
var ckb_status = $("#ckb5").prop('checked');
$('input[type="checkbox"]').prop("checked", ckb_status );
var ckb_status = $("#ckb5").prop('checked');
$("#d1").html("Status = " + ckb_status); 
});
/////
var ckb_status = $("#ckb5").prop('checked');
$("#d1").html("Status = " + ckb_status); 
/////
});
</script>

HTML

<input type=checkbox id='ckb1' value=One> One <br>
<input type=checkbox id='ckb2' value=Two> Two <br>
<input type=checkbox id='ckb3' value=Three> Three <br>
<input type=checkbox id='ckb4' value=Four> Four <br><br>
<input type=checkbox id='ckb5' value=Five> <b>Five</b> <br>
<button type='button' class='btn btn-secondary' id=d1></button>