Child action does not call parent jquery

I have a <a> pair inside a parent div that will perform a specific action when clicked. How can I make it so that when a user clicks on each <a href="xxxx"> , the user will only be linked to other pages and the parent function will not be launched?

+1
source share
1 answer

Stop the click event from the bubbles to the parent, for example:

 $("a").click(function(e) { e.stopPropagation(); }); 

See event.stopPropagation

Demo

+3
source

All Articles