I want to stop propagate event from parent div
to child div
in my html. Here a simple code what I\'m trying to do:
you need to stop propagating in child,not parent so you should write this:
$('.listed-category').click(function(event){
event.stopPropagation();
});
and if you want to click a
tag and stop propagation too,you also need to write this:
$('a#close').click(function(event){
event.stopPropagation();
});
Anyways I will suggest Yuriy's answer. I just want you to know that you should put event.stopPropagation()
in childrens(if you don't want event of parent is run),instead of parent.