Tag : verify-if-checkbox-is-selected

Verify if a checkbox is selected (checked) with jQuery

Verify if a checkbox is selected (checked) with jQuery


<form name="my_form_name" id="my_check_box">
<input type="checkbox" name="my_check_box" id="my_check_box">
</form>
<script type="text/javascript">
jQuery(document).ready(function() {
jQuery('#my_check_box').click(function () {
if (jQuery(this).is(':checked'))
{
alert('My checkbox is checked');
}
}
}
</script>