preventDefault not working

linkaiyi
Follow

If e.preventDefault(); is not working you must use

e.stopImmediatePropagation(); //instead.

For further information take a look at: What’s the difference between event.stopPropagation and event.preventDefault?

$("#mainTabs a").click(function(e) {
     e.stopImmediatePropagation();
});

If you’ve attached other event handlers to the link, you should look into e.stopPropagation() and e.stopImmediatePropagation() instead. Note that return false is equivalent to calling both event.preventDefault() and event.stopPropagation().

Object has 0 attachments

Was this article helpful?

This article is viewed 15 times!

0 Comments

Leave a Comment

Support