Demo of getting checkbox status on Change event

Checkbox

Check and uncheck the checkbox to show the change in status by using on change event of checkbox.

JQuery

<script>
$(document).ready(function() {
$("#ckb").change(function(){
 var ckb_status = $("#ckb").prop('checked');
 //alert(ckb_status);
$('#d1').html( " <b>Status :</b> " + ckb_status );
});
////
var ckb_status = $("#ckb").prop('checked'); // at the time of page load
$('#d1').html( " <b>Status :</b> " + ckb_status );
/////
});
</script>

HTML

<input type=checkbox id='ckb'> Checkbox
<button type='button' class='btn btn-secondary'  id=d1></button>