1.

What is Bubbling and Capturing?

Answer»

When an EVENT OCCURS on the DOM, it does not TAKE place completely on one element. The event bubbles up or goes to its parent, grandparents, and grandparent's parent until it reaches the window in the Bubbling PHASE, whereas the event starts out from window down to the element that prompted the event or the event target in the Capturing Phase.

There are three stages of event propagation:

  • Capturing Phase - the event begins with the window and progresses through each element until it reaches the target element.
  • Target Phase - The event has arrived at the target element.
  • Bubbling Phase - The event bubbles up from the target element and then up EVERY element until it reaches the window.


Discussion

No Comment Found