EVENT.TARGET, in JavaScript, Simplified
Vložit
- čas přidán 21. 11. 2022
- When handling events, an event object, containing all the information about the event, is passed to the callback function you provide. One major property of this event object, is the target property, which contains information about the element that received the event.
In this video, I use examples to explain this property and show why its relevant.
Useful links:
- querySelector explained: • HOW TO SELECT DOM ELEM...
- Event Bubbling: • Event Bubbling in Java...
- Event Delegation: • Event Delegation in Ja...
- Object Destructuring: • Object Destructuring S...
Check out my JavaScript Simplified playlist where I simplify different concepts in JavaScript: • JavaScript Simplified
_____
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 - Věda a technologie
Check out my JavaScript Simplified playlist where I simplify different concepts in JavaScript: czcams.com/play/PLLdz3KlabJv0TBKCbF9aSxIpCxsLiFhEv.html
Thank you for doing this my man Dee! I appreciate it very much. Looking forward for more tutorials from you.
You're welcome 🙏🏾
Bro, your tutorial is much easier to understand than other tutorial I previously watched. Thanks to you!
I'm so so glad to hear this! Thanks for the feedback, and I'm glad you found it easier.
I had done this a few way before but remembering and doing it differently shows problems as well as unexpected solutions. This was the inspiration, bubbling along next to it. yipety doo.
Elements receives different forms of events in the DOM! That opening line explains it all thank you, have subscribed!
I’m so glad to hear ✨
Hi mate, you can really explain stuff in a very easy-to-understand way, thank you ! Greetings from N.Ireland
Heyyy...Greetings from the Netherlands. Thank you so much for the kind feedback. I'm so glad you enjoyed this
Brother... I'm starting in JS and I had this problem with the onload method... after 2 days trying, this was my solution. THANKS!
I'm so so so glad to hear this feedback. You're welcome. Feel free to share topics you'd like me to make videos about.
This really made me understand more about event.target
Wow.. nice explaination.. I have definitely learnt something
Thanks, there is only your video in you tube who explain the use of target deeply, again thanks
Glad it was helpful! You're welcome :)
Very well explained! Thanks for sharing this with us. Keep it up champ!
Glad you liked it! You're welcome
This is the kind of tutorial that i need. Well explained. Thank you so much maaan!
You're welcome! So glad to hear
Really love this guy ❤❤❤❤.
Thanks teacher , I was struggling from this exact thing ! You made it much more easier for me
You're very welcome! I'm so so glad to help
I swear this guy is Nigerian! And you explain it better and what happened after calling the function i just subscribed to your channel as a fellow Nigerian! Bro teach us more.... break it down bro!
Hahah thank you so much and welcome!
Thank you, man, so useful !👏
Glad to hear :)
well explained.Thank you!
You're welcome!
Simply awesome!
Thank you! Cheers!
Nice explanation and examples
thank you!
Really helpful, thanks and well-done 🎉❤
Glad you enjoyed it!
Thank you! My college teacher doesn't explained to me that, only passed the answer, and I was struggling to understand by myself how and why this works.
I'm so glad to hear that this was helpful!
Clarísimo, gracias!!
You're welcome
Wow, bro it's easy to understand thank you
I'm so glad to hear this...you're welcome!
Bro!! You're good! love the explanations...
Thank you so much for this feedback. I'm glad you love it
Thank you so much!!
You’re welcome :)
Wow that is super amazing …thanx🙏
Glad you like it. You're welcome!
nicely explained buddy...thanks
glad you found it so
Thnx a lot sir love from india🇮🇳🇮🇳
You're very welcome!
practical explained bro keep it up
Thank youuu
Thank you.
You're welcome!
came here for javascript tutorial, stayed for the accent, but no joke the video is great thank you.
Haha glad you liked my accent. and thanks for the feedback regarding the video
@@deeecode naija accent i am gussing, leaning javascript too, thank for the video by the way
wow nice explanation👍👍👍
I'm so glad you enjoyed it ;)
I really thought the same but I was doubtful but now I am sure
You're very welcome!
You're good boss. Would like to see a video of how you create content
Coming back to this comment, I'll make a video on this to wrap up the year :)
Will let you know when published
@@deeecode is it out now boss. Really would love to such content.. How you come up with ideas, plan your content, film, edit.. advice
Would really help...
@@Petersonbabs Hi...so sorry I couldn't publish it before the new year like I said I would. But here's the video live now: czcams.com/video/a32fbqPNir4/video.html
@@deeecode thank you
Thaks bro
you're welcome
super helpful
Glad it helped!
Thanks bro..
You're welcome :)
Great 😊
You're welcome
nice explanation bro
Glad you liked it
Awsome content 🔥
You're welcome :)
THANK YOU MAN< BRASIL LOVES YOU
thank you so much 🥹
Tricky stuff. Syntax n all that on top of the why should I need it. I thought this was revision of a hard day but the same errors for me showing how hard it is to know how to alter things just slightly.
very good
Thank you! Cheers!
Amazing
Thank you! Cheers!
thanks sir
Most welcome
Hello I'm having an error with this. Could you explain it to me why?
I'm getting the name Id and assigning it to a variable here.
Const nameId = document.getElementById("nameId");
And then i have an event listener that listen to the assigned element above.
nameId.addEventListener("keyup", () => {
function(); // this function execute when this event is made
});
Now I'm having this (Uncaught TypeError: nameId is null) whenever I'm on a different page on my web. But when I'm on the where this code is being used I'm not having that error.
What i did is i wrap the event listener to an if statement checking if the nameId is not null then execute the event. Is there any other way i could do this?
very nice
you're welcome
love from india
Thank youuuuuuuu!
any reason why you used query selector opposed to getElementById?
there was no specific reason. i've found myself liking querySelector when I want to do any element query (from classes to ids to attributes), and I also wanted to show in this video that there are multiple ways you can get elements from the DOM
Please 🙏 make a video on html data attributes and dataset methods please @deeecode
W tutorial
Nice to know. Thank you
Lucid Explanation
Explanation is clean but I’m still confused 🥲
Hi, In what way are you confused? 🤔