Demo of getting checkbox status on Change event
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>
<?Php
echo "</div><div class='col-md-4'>";
require "templates/side_for_ad.php";
echo "</div></div>";
require "../../templates/temp1/analytic-only.php";
?>