Uncheck a checkbox and trigger its callback function

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 :

  1. $('#myCheckbox').attr('checked', false);
  2. $('#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 :

  1. $('#myCheckbox').click(function() {
  2.      ....