jquery check if checkbox is checked
snippet in javascript

jquery check if checkbox is checked

user1083

//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
}

check whether a checkbox is checked in jQuery

user1594

if ($('#grepperRocks').is(':checked')) {
	// this checkbox is checked
}

jquery check if checkbox is checked

user2209

if($('#on_or_off_checkbox').is(':checked')){
    //I am checked
}