Event Bubbling and Capturing in JavaScript




Understanding Event Bubbling and Event Capturing phase in DOM and how to use it.

Event Bubbling
————————
Event bubbling directs an event to its intended target, it works like this: A button is clicked and the event is directed to the button. If an event handler is set for that object, the event is triggered. If no event handler is set for that object, the event bubbles up (like a bubble in water) to the objects parent.

Original source


31 responses to “Event Bubbling and Capturing in JavaScript”

  1. That was good explanation.
    Could you please answer below questions?

    How to stop bubbling?
    What is difference between stopPeopagation and preventDefault?
    What is use of cancelBubble?

    Also we are waiting for your new videos on interview questions to experienced developer.

    Thank you

Leave a Reply