xxxxxxxxxx
<script>
$(document).ready(function(){
$('input[type="checkbox"]').click(function(){
if($(this).is(":checked")){
console.log("Checkbox is checked.");
}
else if($(this).is(":not(:checked)")){
console.log("Checkbox is unchecked.");
}
});
});
</script>
xxxxxxxxxx
// Assuming the checkbox has an id attribute of 'myCheckbox'
var checkbox = document.getElementById('myCheckbox');
if (checkbox.checked) {
console.log('Checkbox is checked');
} else {
console.log('Checkbox is not checked');
}