//using plane javascript if(document.getElementById('on_or_off_checkbox').checked){//I am checked}//using jQueryif($('#on_or_off_checkbox').is(':checked')){//I am checked}
$("SELECTOR").attr("checked")// Returns ‘true’ if present on the element, returns undefined if not present$("SELECTOR").prop("checked")// Returns true if checked, false if unchecked.$("SELECTOR").is(":checked")// Returns true if checked, false if unchecked.
// Check a checkbox$(selector).prop('checked',true);// Un-check a checkbox$(selector).prop('checked',false);// Determine if checked or not
isChecked =$(selector).prop('checked');
How to check whether a checkbox is checked in jQuery?
//using plane javascript if(document.getElementById('on_or_off_checkbox').checked){//I am checked}//using jQueryif($('#on_or_off_checkbox').is(':checked')){//I am checked}