Events: bubbling i capturing
When an event occurs on a page, the interpreter does not execute it immediately on the element where it happened (the target element). Instead, it travels to the root element through the DOM model, triggering all identical events along the way. This process is how browsers handle events. This journey is called event propagation. Event propagation consists of two phases: Capturing phase – The interpreter starts traveling from the root element to the element where the event occurred. Bubbling phase – The interpreter...
Read more