Say we have:
<div id="parent">d1
<div id="child-1">child-1</div>
<div id="child-2">child-2</div>
</div>
I have an event listener on child-2
.
From what I understand, event capturing will go down the node tree until it reaches the node the event fired.
Does event capturing also go through the sibling children, checking if they are the target that fired the event?
As you can see in this snippet if click on child1 first parent then child1 fires. if you check the console you'll see that both
e.target
are the same, so the event will target the same element on parent and child. when clicking the child1 : event goes from parent to child1 and child2 event never fire up