event bubbling
-
Event bubbling and capturingWeb/DOMBrowser 2019. 9. 29. 01:40
1. Overview 1.1 Event Bubbling When an event happens on an element, it first runs the handlers on it, then on its parent, then all the way up on other ancestors. 1.2 Event Capturing There’s another phase of event processing called “capturing”. It is rarely used in real code, but sometimes can be useful. 2. Event Bubbling Description 2.1 Example Let’s say we have 3 nested elements FORM > DIV > P ..