$(document).ready(function() {
//set initial state.
$('#textbox1').val(this.checked);
$('#checkbox1').change(function() {
if(this.checked) {
var returnVal = confirm("Are you sure?");
$(this).prop("checked", returnVal);
}
$('#textbox1').val(this.checked);
});
});
//jQuery listen for checkbox change
$("#myCheckBoxID").change(function() {
if(this.checked) {
//I am checked
}else{
//I'm not checked
}
});
$('[name="SelectedGroup"]').prop('checked', true);
$('#checkbox1').mousedown(function() {
if (!$(this).is(':checked')) {
this.checked = confirm("Are you sure?");
$(this).trigger("change");
}
});
$( elem ).prop( "checked" )