There are many solutions of change event through click, but not programatically.
See the fiddle here http://jsfiddle.net/pratbhoir/ma7rk0ur/2/
JS Code
$(document).ready(function () {
//set initial state.
$('#textbox1').val($(this).is(':checked'));
//This Event is not called when toggled by button
$('#myCheckBox').change(function () { //-------------if(this.checked
if ($(this).is(":checked")) {
var returnVal = confirm("Are you sure?");
$(this).attr("checked", returnVal);
}
$('#textbox1').val($(this).is(':checked'));
});
});
I want to call the change event, when checkbox event is fired by toggle button.
P.S. Please dont say to put a event on toggle button.
Thank you and have a nice day.