Uncheck a checkbox and trigger its callback function
Hi,
I would like to uncheck a checkbox and trigger its callback function. I tried the following :
- $('#myCheckbox').attr('checked', false);
- $('#myCheckbox').click();
click() triggers the callback function but the checkbox will change to checked, unfortunately.
If I don't call click(), the checkbox is successfully unchecked but the callback won't be triggered.
Any clean solution for this ?
Thank you !
The callback fucntion is :
- $('#myCheckbox').click(function() {
- ....