Hi to all,
I learned about events in JS from MDN. And when I reached the topic about capturing and bubbling phases, there is this site that explains the subject : https://www.quirksmode.org/js/events_order.html
But, I’m a little confused about one example.
element2 is set for bubbling way because of is third argument.
My understanding : Why the handler of the element2 isn’t executed in first ? Due to what I understood, in bubbling phase, the event is propaged from the down to the up.
But, why it’s tell that when element2 is clicked, " The
click event starts in the capturing phase. The event looks if any ancestor element of element2 has a
onclick event handler for the capturing phase."
Thanks in advance for explaining me a little more deep this example and more generally this notion.