DEV Community

Discussion on: Adding Event Listeners to the future DOM elements using Event Bubbling

Collapse
 
safwatfathi profile image
Safwat Fathi

Thank you for your time invested in this article but there are two noticeable mistakes here.

First:

  • adding true as third argument to event listener means that we are using event capturing approach which means the event starts from root element to target element (top to bottom) not from as you said from target to root (bottom to top).

Second:

  • you can achieve the same result without using event capturing, simply remove the third argument of the event listener function and the event bubbling behavior will be implemented.