I've written some jQuery code like this:
$('#checkbox').click(function() {
// do stuff
});
function myFunction() {
$('#checkbox').click();
}
The desired behavior here is for the checkbox click handler to be invoked when myFunction executes. However, the behavior I observe is that the click handler runs and the checkbox is toggled. How can I run the click handler without toggling the checkbox?
.change().