Playback starts YouTube’s embedded player (privacy-enhanced mode).
Bubbling vs Capturing in JavaScript | JavaScript Events Tutorial
ChanneldcodeDescription from the creator
When working with events in JavaScript you have the option of using 'bubbling' or 'capturing' to define the order in which the event handlers fire off. In most cases, bubbling is default.
Typically you don't need to worry about capturing unless you need ultimate control over your event handlers. This concept is only relevant if you have a parent element and a child element which both have event listeners.
When using 'bubbling', events are fired off beginning with the child element and then go up to the parent.
In contrast, 'capturing' means that events are fired off from the parent first, and then down to the child element.
In this video I show you a simple example of how these two options differ with a 'paragraph' tag and a 'strong' tag.
For your reference, check this out:
developer.mozilla.org/en-US/docs/Web/API/EventT…
Follow me on Twitter @dcode!
If this video helped you out and you'd like to see more, make sure to leave a like and subscribe to dcode!
Typically you don't need to worry about capturing unless you need ultimate control over your event handlers. This concept is only relevant if you have a parent element and a child element which both have event listeners.
When using 'bubbling', events are fired off beginning with the child element and then go up to the parent.
In contrast, 'capturing' means that events are fired off from the parent first, and then down to the child element.
In this video I show you a simple example of how these two options differ with a 'paragraph' tag and a 'strong' tag.
For your reference, check this out:
developer.mozilla.org/en-US/docs/Web/API/EventT…
Follow me on Twitter @dcode!
If this video helped you out and you'd like to see more, make sure to leave a like and subscribe to dcode!
About this tutorial
dcode published this 5:32 video tutorial on October 31, 2018. It has been watched 43,979 times on YouTube.
Share
This tutorial in other languages
- FRBubbling vs capturants JavaScript | JavaScript Events Tutorial
- ESBurbujeante vs Captura en JavaScript | Eventos de JavaScript Tutorial
- PTBorbulhando vs Capturing em JavaScript | JavaScript Eventos Tutorial
- ITBubbling vs Acquisizione in JavaScript | JavaScript Eventi Tutorial
- DESprudelnde vs Capturing in JavaScript | JavaScript Events Tutorial
- NLBubbling vs vastleggen in JavaScript | JavaScript Events Tutorial
- RUПузырящийся против Capturing в JavaScript | JavaScript События Учебник
- PLPrzepuszczając vs Przechwytywanie w JavaScript | Zdarzenia JavaScript Tutorial
- JAJavaScriptでキャプチャ対バブリング| JavaScriptのイベントチュートリアル
- ARمحتدما مقابل التقاط في جافا سكريبت | جافا سكريبت الأحداث دروس
- HIबनाम जावास्क्रिप्ट में कैप्चर बुदबुदाती | जावास्क्रिप्ट घटनाक्रम ट्यूटोरियल
- IDMenggelegak vs Menangkap di JavaScript | Acara JavaScript Tutorial