I want to check if a checkbox just got unchecked, when a user clicks on it. The reason for this is because i want to do a validation when a user unchecks a checkbox. Because atl
The Answer already posted .But We can use the jquery in this way also
demo
$(function(){
$('#check1').click(function() {
if($('#check1').attr('checked'))
alert('checked');
else
alert('unchecked');
});
$('#check2').click(function() {
if(!$('#check2').attr('checked'))
alert('unchecked');
else
alert('checked');
});
});