Please find the code below
$("#chkCopy").toggle(function () {
copyDetails();
},
function () {
emptyCopyDetails();
});
// functions which do not have any effect on the checkbox
function copyDetails() {
}
function emptyCopyDetails() {
}
The issue is that checkbox is not showing the checked state.
Thanks in advance
The
.toggle()interrupts the check, since.toggle()actually callse.preventDefault()on theclickevent underneath. Instead of that approach, I’d recommend something like this instead:Here’s an updated/working version of your demo with the above approach.