What is Event Bubbling in JavaScript | JavaScript Tutorials in Hindi | Interview Question #27
Hi,
I'm Rohit Verma, Welcome to our YouTube Channel Still Learning.
About this video :-
Event bubbling is a behavior in JavaScript where events triggered on a nested element will "bubble up" and trigger events on all of its parent elements, all the way up to the document object, unless the propagation of the event is explicitly stopped.
For example, consider a button element nested within a div element. If the button is clicked, a click event will be triggered on the button element, which will then "bubble up" to the div element, and then to any other parent elements, such as the body and document object. Each parent element can handle the event if it has a corresponding event listener attached to it.
This behavior can be useful in certain scenarios where you want to handle an event on multiple elements with a single event listener attached to a parent element. However, it can also lead to unintended consequences if the propagation of the event is not handled properly, such as triggering unwanted events on parent elements.
To stop the event bubbling, you can use the stopPropagation() method on the event object, which prevents the event from propagating any further.
JavaScript Tutorials in Hindi | JavaScript Interview Questions Playlist:-
https://www.youtube.com/watch?v=M5gwqfRGI9A&list=PLpl0GEINwjARM0w6q_e3skmIgU4Fri_L1
React JS Tutorials in Hindi Playlist:-
https://www.youtube.com/watch?v=TWLDQSo30JM&list=PLpl0GEINwjASRRy7WlpCAYasEpp3XXjT_
HTML Tutorials in Hindi Playlist:-
https://www.youtube.com/watch?v=TpJu8K5xaAU&list=PLpl0GEINwjAS_rCqrP38GPAfpah8gbrQY
Watch Another Videos 👇
SSC MTS 2017 Most Important GK Top 100 Questions with Answers
https://www.youtube.com/watch?v=34G4v82777s
All Countries Prime Ministers List, Most Important GK
https://www.youtube.com/watch?v=EK03zZmzlzw
SSC MTS 2017 Most Important GK/General Science Top 50 Questions with Answers
https://www.youtube.com/watch?v=xCpxCkNifuk
SSC MTS 2017 Top 30 Most Asked Spelling Mistakes in English MTS Previous Exam
https://www.youtube.com/watch?v=Cl0beEZGX-0
Social Links:-
YouTube : https://www.youtube.com/@StillLearning
Facebook : https://www.facebook.com/stilllearning.in
Twitter : https://twitter.com/stilllearningin
#javascripttutorials
#interviewquestions
#javascriptinterviewquestions
#javascripttutorialsinhindi
#StillLearning
#TutorialsInHindi
-~-~~-~~~-~~-~-
Please watch: "#1 Complete Responsive Website using REACT JS & Bootstrap with Source Code 2024 🔥🔥"
https://www.youtube.com/watch?v=TmlpFSSKT3s
-~-~~-~~~-~~-~-