Event Delegation in JavaScript, Simplified

  Рет қаралды 11,065

Deeecode The Web

Deeecode The Web

Жыл бұрын

Event Delegation is an event handling pattern based up on the concept of Event Bubbling in the DOM. The idea is that you delegate the handling of an event (triggered on an element) to its parent or ancestor element.
This can improve performance in your applications as you use fewer event listeners for the same logic.
Learn about Event Bubbling here: • Event Bubbling in Java...
Learn about the querySelector document method here: • HOW TO SELECT DOM ELEM...
_____
Subscribe to My Channel: bit.ly/deeecode
_____
🌟 About Me:
Dillion Megida, creator of DEEECODE, is a Software Engineer, Developer Advocate and a Content Creator passionate about simplifying topics around Tech via articles and videos.
_____
⚡️ Connect with me:
- Personal youtube: / dillionmegida
- Personal website: dillionmegida.com/
- Twitter: / iamdillion
- Instagram: / deeecode
- LinkedIn: / dillionmegida
- GitHub: github.com/dillionmegida
_____
#deeecode

Пікірлер: 62
@tommuc8538
@tommuc8538 Жыл бұрын
Wow, that was super clear and simply. Thx.
@deeecode
@deeecode Жыл бұрын
Glad you liked it! You're welcome
@riyatiwari7178
@riyatiwari7178 Жыл бұрын
Thank you so much, loved it! Keep uploading this series. ❣❣
@deeecode
@deeecode Жыл бұрын
Thank you! Will do!
@victortarroni
@victortarroni 11 ай бұрын
Super clear! Thanks Mate!
@deeecode
@deeecode 11 ай бұрын
So glad to hear. you're welcome!
@timeless268
@timeless268 6 ай бұрын
The explanation is AWESOME ! Thank you so much❤
@deeecode
@deeecode 6 ай бұрын
So so glad it was helpful!
@PaulJBurgess
@PaulJBurgess 4 ай бұрын
Thank you! I'll be back to this channel, I'm pretty sure.
@mlindatech
@mlindatech 10 ай бұрын
Man you are wonderfully simple English straight to the point beautiful✌️🙏
@deeecode
@deeecode 10 ай бұрын
Thanks for the feedback 🙌🏾
@FranklinAirlonger-jm3pj
@FranklinAirlonger-jm3pj 11 ай бұрын
You’re good bro, the simplicity of your classes are superb
@deeecode
@deeecode 11 ай бұрын
I appreciate that! Glad you like them
@BriariusTitan
@BriariusTitan 9 ай бұрын
Thanks for the help, you clarified it well.
@deeecode
@deeecode 8 ай бұрын
You're welcome!
@HarshSingh-hk8fe
@HarshSingh-hk8fe 8 ай бұрын
that's really a cleanest explaination no bullshit straight to the point thanks alot bro
@deeecode
@deeecode 8 ай бұрын
So glad you find it helpful 😊
@user-nm7in5cm3q
@user-nm7in5cm3q 11 ай бұрын
great video - thank you!!
@deeecode
@deeecode 11 ай бұрын
You're very much welcome!
@adibahbab6859
@adibahbab6859 10 ай бұрын
Thanks man.....
@keddycameron2723
@keddycameron2723 Жыл бұрын
very clear! thank u
@deeecode
@deeecode Жыл бұрын
You are welcome!
@JD-hq1kn
@JD-hq1kn Жыл бұрын
You really simplify things.. Thanks man !!
@deeecode
@deeecode Жыл бұрын
you're super super welcome :)
@JD-hq1kn
@JD-hq1kn Жыл бұрын
@@deeecode how can I get in touch with you bro ?
@RishabhJain-uv7zj
@RishabhJain-uv7zj 6 ай бұрын
Nice explanation. Thanks
@deeecode
@deeecode 6 ай бұрын
Glad it was helpful!
@himxai
@himxai 8 ай бұрын
Thanks love your explanation 💯
@deeecode
@deeecode 8 ай бұрын
Glad it was helpful!
@walkingalonewithyusuf9987
@walkingalonewithyusuf9987 10 ай бұрын
Your teaching style is really amazing ❤❤❤
@deeecode
@deeecode 6 ай бұрын
Glad you enjoyed it
@Wildrespect
@Wildrespect 9 ай бұрын
Nahh… this tut right here is dope🔥
@deeecode
@deeecode 9 ай бұрын
I’m glad you find this so 😀
@york2301
@york2301 Жыл бұрын
Keep up the good work!
@deeecode
@deeecode Жыл бұрын
Thank you so much!
@gaurangshroff
@gaurangshroff Жыл бұрын
Very well explained
@deeecode
@deeecode Жыл бұрын
So nice to hear
@malikmartin
@malikmartin 3 ай бұрын
Thanks! This should help me write cleaner (and more optimized) code!
@deeecode
@deeecode 3 ай бұрын
Glad it helped!
@hybs9473
@hybs9473 Жыл бұрын
Maaan! Thank you for this. You use simple english to explain things, straight to the point, very concise with a lot of examples. I easily understood what event delegation is. Only gripe I had is the 'target' event not explained enough, but that's on me, I need to research more on that. Thank you very much. Might check out your other tutorials because of how well you teach the topics. Hope you get a lot of subscribers so you get motivated to post more good tutorials like this.
@deeecode
@deeecode Жыл бұрын
Thank you so much for the helpful feedback 🙏🏾 I appreciate it. And thanks for the kind words also You mean the target object not being explained clearly?
@hybs9473
@hybs9473 Жыл бұрын
@@deeecode Hey man, Yes, that target object, but that's on me, I have to research that on my own to learn further. Can I request some topic for other videos? Can you do a tutorial for promise, async and await and a separate video talking about JSON and API's? I'm currently enrolled on UDEMY but I like your teaching style more (slow and clear that is more suitable for beginners). Thank you man, don't sweat my request too much, I understand that it's pretty hard to slip these things in your schedule.
@DillionMegida
@DillionMegida Жыл бұрын
@@hybs9473 I appreciate your feedback. I'll push in event.target on my list. Promises, async and await are already there--scheduling a time is the problem. Will also add JSON and APIs to the list. But what I can say right now is that expect a video on event.target on my channel soon. Will leave a comment here when I do that :) Thanks again for the engagement. And I love that my videos are simple enough 😇
@deeecode
@deeecode Жыл бұрын
Here is the video on event target kzfaq.info/get/bejne/hJ-meLtyvLbdnok.html 😇 I would love your feedback on it after watching, if it's simple enough. Thank you
@joelfuelling8725
@joelfuelling8725 Жыл бұрын
@@DillionMegida Fun tip, change your e.target to a variable right away you can reference so you're not writing e.target everywhere.
@PonnaiyaSwami
@PonnaiyaSwami 6 ай бұрын
maaaaaaaaaaaaaaaaan!! you're a legend.
@deeecode
@deeecode 6 ай бұрын
Glad you found the video helpful :)
@cescr3821
@cescr3821 Жыл бұрын
awesome dude ty.
@deeecode
@deeecode Жыл бұрын
You're greatly welcome!
@hamzamellahi120
@hamzamellahi120 6 ай бұрын
Loooove it, keep it uP!
@deeecode
@deeecode 6 ай бұрын
Thank you! Will do!
@PaulJBurgess
@PaulJBurgess 4 ай бұрын
Subbed!
@Vc00018
@Vc00018 Жыл бұрын
very helpfull !!
@deeecode
@deeecode Жыл бұрын
Glad it was helpful!
@godugunurumanoj733
@godugunurumanoj733 8 ай бұрын
Awesome explanation i loved it.
@deeecode
@deeecode 8 ай бұрын
Glad it was helpful!
@godugunurumanoj733
@godugunurumanoj733 8 ай бұрын
Yes I am confident about this concept
@thefootballcore
@thefootballcore 4 ай бұрын
hey, do you play football , if yes, Chelsea is ready to sign you mate , you match perfectly with their needs
@youtubejproasters1224
@youtubejproasters1224 11 ай бұрын
Hey man nice video, out of curiosity, what if you had to put in these 3 buttons a different action to happen after a click event, would you make the if statement with their ids as validator? And you would make 3 if statements for different action if event.target === button 1 for example etc etc ?
@mlindatech
@mlindatech 10 ай бұрын
I really like your question man!
@shishirbhurtel7978
@shishirbhurtel7978 6 ай бұрын
See the complexity of your application. If the purpose of the different buttons/child inside parent element have less distinct or similar purpose, you can use conditional handling. Else if they have distinct purposes using different eventListners in each buttons/child will be more helpful.
VAR, LET and CONST - Differences between these keywords
13:10
Deeecode The Web
Рет қаралды 2,5 М.
Event Delegation in Javascript | UI/Frontend Interview Question
27:45
I wish I could change THIS fast! 🤣
00:33
America's Got Talent
Рет қаралды 98 МЛН
Always be more smart #shorts
00:32
Jin and Hattie
Рет қаралды 43 МЛН
Неприятная Встреча На Мосту - Полярная звезда #shorts
00:59
Полярная звезда - Kuzey Yıldızı
Рет қаралды 7 МЛН
Sigma Girl Past #funny #sigma #viral
00:20
CRAZY GREAPA
Рет қаралды 30 МЛН
Why Signals Are Better Than React Hooks
16:30
Web Dev Simplified
Рет қаралды 459 М.
UI Libraries Are Dying, Here's Why
13:28
Theo - t3․gg
Рет қаралды 275 М.
Event delegation with vanilla JavaScript
5:11
Go Make Things
Рет қаралды 427
Event Bubbling in JavaScript, Simplified
5:00
Deeecode The Web
Рет қаралды 14 М.
EVENT.TARGET, in JavaScript, Simplified
7:54
Deeecode The Web
Рет қаралды 21 М.
5 JavaScript Concepts You HAVE TO KNOW
9:38
James Q Quick
Рет қаралды 1,4 МЛН
STOP Watching Coding Tutorials Right Now! My LEARNING FRAMEWORK
12:19
Harkirat Singh
Рет қаралды 232 М.
1$ vs 500$ ВИРТУАЛЬНАЯ РЕАЛЬНОСТЬ !
23:20
GoldenBurst
Рет қаралды 1,5 МЛН
Неразрушаемый смартфон
1:00
Status
Рет қаралды 2,3 МЛН
Hisense Official Flagship Store Hisense is the champion What is going on?
0:11
Special Effects Funny 44
Рет қаралды 2,6 МЛН