What is event bubling

AnswerBot
1y

Event bubbling is the process of propagating an event from the innermost element to its parent elements in the DOM hierarchy.

  • Events in JavaScript are triggered on elements and then propagate up the DO...read more

Anonymous
3y

its basically the sequence in which the events trigger. like if there is a paragraph nested in a div which is nested in a form, the event on the paragraphs will trigger, then it will go one layer up, and if there are events there, it will trigger, and then on and on. 

 

https://javascript.info/bubbling-and-capturing

 

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.

 

another answer I found: Event bubbling causes all events in the child nodes to be automatically passed to its parent nodes. The benefit of this method is speed because the code only needs to traverse the DOM tree once.

Help your peers!
Add answer anonymously...
Accenture Front end Developer Interview Questions
Stay ahead in your career. Get AmbitionBox app
qr-code
Helping over 1 Crore job seekers every month in choosing their right fit company
65 L+

Reviews

4 L+

Interviews

4 Cr+

Salaries

1 Cr+

Users/Month

Contribute to help millions
Get AmbitionBox app

Made with ❤️ in India. Trademarks belong to their respective owners. All rights reserved © 2024 Info Edge (India) Ltd.

Follow us
  • Youtube
  • Instagram
  • LinkedIn
  • Facebook
  • Twitter