1//using plane javascript
2if(document.getElementById('on_or_off_checkbox').checked) {
3 //I am checked
4}
5
6//using jQuery
7if($('#on_or_off_checkbox').is(':checked')){
8 //I am checked
9}
1$('.myCheckbox').prop('checked', true);
2$('.myCheckbox').prop('checked', false);
1// Check a checkbox
2$(selector).prop('checked', true);
3// Un-check a checkbox
4$(selector).prop('checked', false);
5// Determine if checked or not
6isChecked = $(selector).prop('checked');