filmov
tv
Explain the concept of event bubbling and event capturing JavaScript ? || javascript interview QA

Показать описание
Event bubbling and event capturing are two phases of event propagation in the DOM (Document Object Model).
In event capturing, the event is captured by the outermost element and propagated to the innermost element. This means that the event starts from the top of the DOM hierarchy and goes down to the target element.
In event bubbling, the event starts from the target element and bubbles up through its ancestors, propagating to the outermost element.
In event capturing, the event is captured by the outermost element and propagated to the innermost element. This means that the event starts from the top of the DOM hierarchy and goes down to the target element.
In event bubbling, the event starts from the target element and bubbles up through its ancestors, propagating to the outermost element.