JavaScript Tutorial in Hindi for Beginners [Part 63] Event Bubbling & Event Capturing in JavaScript

preview_player
Показать описание
#Javascript #Tutorial #Hindi

In this video i will talk about Event Bubbling & Event Capturing in JavaScript.

When you click the button, you’re clicking not only the button but also the button’s container, the div, and the whole webpage.

Event flow explains the order in which events are received on the page from the element where the event occurs and propagated through the DOM tree.

There are two main event models: event bubbling and event capturing.

1. Event bubbling

In the event bubbling model, an event starts at the most specific element and then flows upward toward the least specific element (the document or even window).

When you click the button, the click event occurs in the following order:

button
div with the id container
body
html
document

2. Event capturing

In the event capturing model, an event starts at the least specific element and flows downward toward the most specific element.

When you click the button, the click event occurs in the following order:

document
html
body
div with the id container
button

Join this channel to support Tech Gun:
Рекомендации по теме
Комментарии
Автор

Was asked this question today in an interview. Hadn't even heard of these concepts and I have been using JavaScript for two years.

Thanks.

hashamali
Автор

What easiest explanation.
😱😮 Great...

shaunmalik
Автор

I must say this was the most lucid explanation!!!👌

arpitabehura
Автор

You Describe the most difficult concept in most easiest way. Thank a lot.

subhamoy.r
Автор

one of the best explanation tussi cha gaye GURU

right-network
Автор

very well explained..you are the best teacher! thanks!

wheresisgod
Автор

Liked and subscribed. Thanks a lot. bahut badhiya bhai saahab.

shortme
Автор

bro love you man you really helped me alot

ammarnaeem
Автор

Sir views down jaroor hue hai but aap padhana nahi chodna coz god is planning something huge for you, humare college me bolte js padhna h toh poori duniya Mai tech gun se better koi nhi padha sakta.

mrshoya.
Автор

Sir, please, tell the use of this concept...

sharadsharma
Автор

Propogation child elements ko bhi rokta hai sir?

Prophetsarkar
Автор

Sir I want to ask you that I have PCB in 12 will do bca and then mca so sir can I become software engineer or software developer ?? please reply sir no one is giving me this questions answer 🙏🙏🙏🙏

happnitykitchen
Автор

this stopPropagation is only working for event bubbling ?why?

akritishukla
Автор

NEXT PHP THEN MYSQL THEN JQUERY ANGULAR REACT THEN C++ JAVA PYTHON

XYZ-wrzb