//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}
// Check a checkbox$(selector).prop('checked',true);// Un-check a checkbox$(selector).prop('checked',false);// Determine if checked or not
isChecked =$(selector).prop('checked');
$(document).ready(function(){//set initial state.$('#textbox1').val($(this).is(':checked'));$('#checkbox1').change(function(){$('#textbox1').val($(this).is(':checked'));});$('#checkbox1').click(function(){if(!$(this).is(':checked')){returnconfirm("Are you sure?");}});});