JS - What is event delegation and event propagation?
Event delegation is when you attach a listener to an element, all of its children will also be able to trigger that listener. An example would be if you had a <ul></ul>Â of 10 <li></li> . You would just need to have one event listener on the <ul></ul>.
Event bubbling and capturing are two ways of propagation.
Bubbling means that when a child and parent both have an event listener for the same event, the child handles the event before the parent.
Capturing is the opposite and means that the parent will handle the event before its children.

















