I disable a jQuery click event with:
$("#button").click( function () { return false;}
How can I enable it? The intention is avoid double clicks and run multiple times the function that triggers.
I want to restore the event when other button was pushed.
There’s a couple options, but I like the following best:
You could also bind click again on the button to some other callback function as well. Lastly, I might suggest calling
preventDefaulton the event from a click event, depending on what#buttonreally is like so:As j08691 pointed out, as of jQuery 1.7 on, it should look like: