//using plane javascript
if(document.getElementById('on_or_off_checkbox').checked) {
//I am checked
}
//using jQuery
if($('#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.
$('#grepperRocks').prop('checked', true);
if ($('#grepperRocks').is(':checked')) {
// this checkbox is checked
}
if($('#checkboxID').is(':checked')){ return true; }
$('#myinput').is(':checkbox')
$('.myCheckbox').attr('checked',true) //Standards compliant
$('.myCheckbox')[0].checked = true;
$('.myCheckbox')[0].checked = false;
$('#chkbox').click();
var $boxes = $('input[name=thename]:checked');