Possible Duplicate:
How to prevent other event handlers, from first handler, in jQuery
I have two jQuery functions like this:
$('#click-me').live('click', function(event) {
alert("Hello World");
event.preventDefault();
});
$('#click-me').live('click', function(event) {
alert("Goodbye World");
});
It may sound strange, but let’s say I don’t want the second function (with the “goodbye world” alert to be executed), how would I do that? The event.preventDefault doesn’t help.
Thanks
Peter
You can use
event.stopImmediatePropagation()to prevent all following handlers from being triggered.