Sale is live! Enjoy 70% Off! Use Credit/Debit Cards in India and PayPal outside of India for better experience!

How to check whether a checkbox is checked or not in jQuery?


You can use is() function to check whether a checkbox is checked or not.

Source Code:

<script>
$(document).ready(function () {
	if ($("input[type=checkbox]").is(":checked")) {
		alert("Checked");
	}
	else {
		alert("Unchecked");
	}
});

//You can also add click event to it

$(document).ready(function () {
	$("input[type=checkbox]").click(function (){
		if ($("input[type=checkbox]").is(":checked")) {
			alert("Checked");
		}
		else {
			alert("Unchecked");
		}
	});
});
</script>

Free - Download it right now!


Tested

Include all files

Demo Download

Reviews and Comments