+ 1
Stop parent from catching child event in JS
I have a parent Div that has a click event. There are multiple child divs that have there own events. When clicking on a child both the child and the parent events get triggered (bubbling) I did add Event.stopPropogatio() in child elements which works tbh.. But I was wondering if it is possible to do something about the parent element so it ignores events bubbling from its children, or in other words the parents should only react to its own events. Not sure about if its a duplicate question.. Needed to ask in hurry
2 odpowiedzi
+ 1
In the beginning Check the clicked element from the event arguments