EVENT.TARGET, in JavaScript, Simplified

Sdílet
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

Komentáře • 108

  • @deeecode
    @deeecode  Před rokem

    Check out my JavaScript Simplified playlist where I simplify different concepts in JavaScript: czcams.com/play/PLLdz3KlabJv0TBKCbF9aSxIpCxsLiFhEv.html

  • @hybs9473
    @hybs9473 Před rokem +5

    Thank you for doing this my man Dee! I appreciate it very much. Looking forward for more tutorials from you.

  • @archangel4894
    @archangel4894 Před rokem +3

    Bro, your tutorial is much easier to understand than other tutorial I previously watched. Thanks to you!

    • @deeecode
      @deeecode  Před rokem

      I'm so so glad to hear this! Thanks for the feedback, and I'm glad you found it easier.

  • @jamblob3208
    @jamblob3208 Před 4 měsíci

    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.

  • @marypaul9627
    @marypaul9627 Před 2 měsíci

    Elements receives different forms of events in the DOM! That opening line explains it all thank you, have subscribed!

    • @deeecode
      @deeecode  Před měsícem

      I’m so glad to hear ✨

  • @mariopizzaro
    @mariopizzaro Před rokem

    Hi mate, you can really explain stuff in a very easy-to-understand way, thank you ! Greetings from N.Ireland

    • @deeecode
      @deeecode  Před rokem

      Heyyy...Greetings from the Netherlands. Thank you so much for the kind feedback. I'm so glad you enjoyed this

  • @Kivencito
    @Kivencito Před rokem +4

    Brother... I'm starting in JS and I had this problem with the onload method... after 2 days trying, this was my solution. THANKS!

    • @deeecode
      @deeecode  Před rokem

      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.

  • @destinyifeanyichilaka6434
    @destinyifeanyichilaka6434 Před 4 měsíci

    This really made me understand more about event.target

  • @pauledukere8353
    @pauledukere8353 Před 5 měsíci

    Wow.. nice explaination.. I have definitely learnt something

  • @explorewithpraveen
    @explorewithpraveen Před 3 měsíci

    Thanks, there is only your video in you tube who explain the use of target deeply, again thanks

    • @deeecode
      @deeecode  Před 3 měsíci

      Glad it was helpful! You're welcome :)

  • @JhonLogix
    @JhonLogix Před rokem

    Very well explained! Thanks for sharing this with us. Keep it up champ!

    • @deeecode
      @deeecode  Před rokem +1

      Glad you liked it! You're welcome

  • @CLeovison
    @CLeovison Před rokem

    This is the kind of tutorial that i need. Well explained. Thank you so much maaan!

    • @deeecode
      @deeecode  Před 11 měsíci

      You're welcome! So glad to hear

  • @isaacaninta6551
    @isaacaninta6551 Před 4 měsíci

    Really love this guy ❤❤❤❤.

  • @tanoypaul
    @tanoypaul Před 3 měsíci

    Thanks teacher , I was struggling from this exact thing ! You made it much more easier for me

    • @deeecode
      @deeecode  Před 3 měsíci

      You're very welcome! I'm so so glad to help

  • @AvidAfrican
    @AvidAfrican Před 10 měsíci +1

    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!

    • @deeecode
      @deeecode  Před 9 měsíci

      Hahah thank you so much and welcome!

  • @codingsenpai
    @codingsenpai Před 10 měsíci

    Thank you, man, so useful !👏

  • @noobme1068
    @noobme1068 Před rokem

    well explained.Thank you!

  • @aprendahebraicocomabiblia1090
    @aprendahebraicocomabiblia1090 Před 4 měsíci +1

    Simply awesome!

  • @ormtosteson9553
    @ormtosteson9553 Před 4 měsíci

    Nice explanation and examples

  • @yaniquedickson8276
    @yaniquedickson8276 Před měsícem

    thank you!

  • @famero_xo
    @famero_xo Před měsícem

    Really helpful, thanks and well-done 🎉❤

  • @caioluna9229
    @caioluna9229 Před rokem

    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.

    • @deeecode
      @deeecode  Před rokem

      I'm so glad to hear that this was helpful!

  • @marielfigueroacolmenares1869

    Clarísimo, gracias!!

  • @nagarjuna5557
    @nagarjuna5557 Před 8 měsíci

    Wow, bro it's easy to understand thank you

    • @deeecode
      @deeecode  Před 7 měsíci

      I'm so glad to hear this...you're welcome!

  • @davidezih3510
    @davidezih3510 Před rokem

    Bro!! You're good! love the explanations...

    • @deeecode
      @deeecode  Před rokem +1

      Thank you so much for this feedback. I'm glad you love it

  • @louiebridges174
    @louiebridges174 Před 2 měsíci

    Thank you so much!!

  • @dinasalah855
    @dinasalah855 Před rokem

    Wow that is super amazing …thanx🙏

    • @deeecode
      @deeecode  Před rokem

      Glad you like it. You're welcome!

  • @nabeelkhan-dp2fc
    @nabeelkhan-dp2fc Před rokem

    nicely explained buddy...thanks

  • @chocolyte1950
    @chocolyte1950 Před 10 měsíci +1

    Thnx a lot sir love from india🇮🇳🇮🇳

  • @imanariyobaptiste8177
    @imanariyobaptiste8177 Před 11 měsíci

    practical explained bro keep it up

  • @fabrice9848
    @fabrice9848 Před 11 měsíci

    Thank you.

  • @cescr3821
    @cescr3821 Před rokem

    came here for javascript tutorial, stayed for the accent, but no joke the video is great thank you.

    • @deeecode
      @deeecode  Před rokem +2

      Haha glad you liked my accent. and thanks for the feedback regarding the video

    • @avalonstudio2753
      @avalonstudio2753 Před rokem

      @@deeecode naija accent i am gussing, leaning javascript too, thank for the video by the way

  • @archonarchon6613
    @archonarchon6613 Před 3 měsíci

    wow nice explanation👍👍👍

    • @deeecode
      @deeecode  Před 3 měsíci

      I'm so glad you enjoyed it ;)

  • @iamnottech8918
    @iamnottech8918 Před 3 měsíci

    I really thought the same but I was doubtful but now I am sure

  • @Petersonbabs
    @Petersonbabs Před 9 měsíci

    You're good boss. Would like to see a video of how you create content

    • @deeecode
      @deeecode  Před 7 měsíci +1

      Coming back to this comment, I'll make a video on this to wrap up the year :)
      Will let you know when published

    • @Petersonbabs
      @Petersonbabs Před 7 měsíci

      @@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...

    • @deeecode
      @deeecode  Před 6 měsíci +1

      @@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

    • @Petersonbabs
      @Petersonbabs Před 6 měsíci

      @@deeecode thank you

  • @BSITVinluanEner
    @BSITVinluanEner Před rokem

    Thaks bro

  • @enibondarenko1233
    @enibondarenko1233 Před rokem

    super helpful

  • @w23music17
    @w23music17 Před rokem

    Thanks bro..

  • @mnnw148
    @mnnw148 Před rokem

    Great 😊

  • @ricko13
    @ricko13 Před rokem

    nice explanation bro

  • @MatheusPereira-nn9dj
    @MatheusPereira-nn9dj Před rokem

    Awsome content 🔥

  • @binhors6854
    @binhors6854 Před rokem

    THANK YOU MAN< BRASIL LOVES YOU

  • @jamblob3208
    @jamblob3208 Před 4 měsíci

    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.

  • @bananabread6758
    @bananabread6758 Před rokem

    very good

  • @therobber
    @therobber Před 11 měsíci

    Amazing

  • @vikitalk
    @vikitalk Před 9 měsíci

    thanks sir

  • @relaxsongwithjeff1263
    @relaxsongwithjeff1263 Před 10 měsíci

    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?

  • @user-ko8cl4dd9w
    @user-ko8cl4dd9w Před rokem

    very nice

  • @TEJASSADADE
    @TEJASSADADE Před rokem

    love from india

  • @zachmathias26
    @zachmathias26 Před rokem

    any reason why you used query selector opposed to getElementById?

    • @deeecode
      @deeecode  Před rokem +2

      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

  • @Dee_Dev
    @Dee_Dev Před 6 měsíci

    Please 🙏 make a video on html data attributes and dataset methods please @deeecode

  • @hexgrade177
    @hexgrade177 Před rokem

    W tutorial

  • @devSackey
    @devSackey Před 2 měsíci

    Lucid Explanation

  • @iamvictorjack
    @iamvictorjack Před 9 měsíci

    Explanation is clean but I’m still confused 🥲

    • @deeecode
      @deeecode  Před 9 měsíci

      Hi, In what way are you confused? 🤔