Jquery, How get checkbox unchecked event and checkbox value?
checkbox, html, javascript, jquery
Solution
Your selector will only attach event to element which are selected in the beginning. You need to determine check unchecked state when value is changed:
$("#countries input:checkbox").change(function() {
var ischecked= $(this).is(':checked');
if(!ischecked)
alert('uncheckd ' + $(this).val());
});
Working Demo
Problem
I want to get `checkbox` value using jQuery when to uncheck the checked checkbox and show that unchecked value in the popup. I've tried below code but it not work ``` $("#countries input:checkbox:not(:checked)").click(function(){ var val = $(this).val(); alert('uncheckd' + val); }); ``` Is it possible to get unchecked value in this way?