EVENT.TARGET, in JavaScript, Simplified

Поделиться
HTML-код
  • Опубликовано: 2 окт 2024
  • 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....
    Twitter: / iamdillion
    Instagram: / deeecode
    LinkedIn: / dillionmegida
    GitHub: github.com/dil...
    _____
    #deeecode

Комментарии • 112

  • @deeecode
    @deeecode  Год назад

    Check out my JavaScript Simplified playlist where I simplify different concepts in JavaScript: ruclips.net/p/PLLdz3KlabJv0TBKCbF9aSxIpCxsLiFhEv

  • @hybs9473
    @hybs9473 Год назад +5

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

    • @deeecode
      @deeecode  Год назад

      You're welcome 🙏🏾

  • @Kivencito
    @Kivencito Год назад +7

    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  Год назад

      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.

  • @explorewithpraveen
    @explorewithpraveen 5 месяцев назад

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

    • @deeecode
      @deeecode  5 месяцев назад

      Glad it was helpful! You're welcome :)

  • @isaacaninta6551
    @isaacaninta6551 7 месяцев назад

    Really love this guy ❤❤❤❤.

  • @Paulina-sc1xd
    @Paulina-sc1xd 2 месяца назад

    Thank you very much for this video, it was very helpful👍

  • @caioluna9229
    @caioluna9229 Год назад

    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  Год назад

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

  • @archangel4894
    @archangel4894 Год назад +5

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

    • @deeecode
      @deeecode  Год назад

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

  • @Petersonbabs
    @Petersonbabs 11 месяцев назад

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

    • @deeecode
      @deeecode  9 месяцев назад +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 9 месяцев назад

      @@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  9 месяцев назад +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: ruclips.net/video/a32fbqPNir4/видео.html

    • @Petersonbabs
      @Petersonbabs 9 месяцев назад

      @@deeecode thank you

  • @iamnottech8918
    @iamnottech8918 5 месяцев назад

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

    • @deeecode
      @deeecode  5 месяцев назад

      You're very welcome!

  • @saurabhsinghpatel3090
    @saurabhsinghpatel3090 2 месяца назад

    Love from india , you are just amazing , loved the way of explanation you have resolved my doubt and gave a detailed explanation with the use case , that helped a lot.Thanks a lot man.Keep doing this amazing work.

  • @codingsenpai
    @codingsenpai Год назад

    Thank you, man, so useful !👏

    • @deeecode
      @deeecode  9 месяцев назад

      Glad to hear :)

  • @aprendahebraicocomabiblia1090
    @aprendahebraicocomabiblia1090 6 месяцев назад +1

    Simply awesome!

    • @deeecode
      @deeecode  3 месяца назад

      Thank you! Cheers!

  • @noozytechz
    @noozytechz Месяц назад

    your teaching is next level bro, keep doing, you will have million subs

  • @chocolyte1950
    @chocolyte1950 Год назад +1

    Thnx a lot sir love from india🇮🇳🇮🇳

    • @deeecode
      @deeecode  11 месяцев назад

      You're very welcome!

  • @relaxsongwithjeff1263
    @relaxsongwithjeff1263 Год назад

    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?

  • @jamblob3208
    @jamblob3208 6 месяцев назад

    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.

  • @louiebridges174
    @louiebridges174 4 месяца назад

    Thank you so much!!

    • @deeecode
      @deeecode  3 месяца назад

      You’re welcome :)

  • @ormtosteson9553
    @ormtosteson9553 7 месяцев назад

    Nice explanation and examples

  • @yaniquedickson8276
    @yaniquedickson8276 3 месяца назад

    thank you!

  • @AvidAfrican
    @AvidAfrican Год назад +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  11 месяцев назад

      Hahah thank you so much and welcome!

  • @Dee_Dev
    @Dee_Dev 9 месяцев назад

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

  • @dinasalah855
    @dinasalah855 Год назад

    Wow that is super amazing …thanx🙏

    • @deeecode
      @deeecode  Год назад

      Glad you like it. You're welcome!

  • @noobme1068
    @noobme1068 Год назад

    well explained.Thank you!

  • @nabeelkhan-dp2fc
    @nabeelkhan-dp2fc Год назад

    nicely explained buddy...thanks

    • @deeecode
      @deeecode  Год назад

      glad you found it so

  • @devSackey
    @devSackey 5 месяцев назад

    Lucid Explanation

  • @Spunky_Tx
    @Spunky_Tx Месяц назад

    Thanks man

  • @fabrice9848
    @fabrice9848 Год назад

    Thank you.

  • @jamblob3208
    @jamblob3208 6 месяцев назад

    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.

  • @tanoypaul
    @tanoypaul 5 месяцев назад

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

    • @deeecode
      @deeecode  5 месяцев назад

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

  • @zachmathias26
    @zachmathias26 Год назад

    any reason why you used query selector opposed to getElementById?

    • @deeecode
      @deeecode  Год назад +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

  • @pauledukere8353
    @pauledukere8353 7 месяцев назад

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

  • @binhors6854
    @binhors6854 Год назад

    THANK YOU MAN< BRASIL LOVES YOU

    • @deeecode
      @deeecode  Год назад

      thank you so much 🥹

  • @ricko13
    @ricko13 Год назад

    nice explanation bro

  • @famero_xo
    @famero_xo 3 месяца назад

    Really helpful, thanks and well-done 🎉❤

    • @deeecode
      @deeecode  3 месяца назад

      Glad you enjoyed it!

  • @nagarjuna5557
    @nagarjuna5557 10 месяцев назад

    Wow, bro it's easy to understand thank you

    • @deeecode
      @deeecode  10 месяцев назад

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

  • @destinyifeanyichilaka6434
    @destinyifeanyichilaka6434 6 месяцев назад

    This really made me understand more about event.target

  • @w23music17
    @w23music17 Год назад

    Thanks bro..

  • @imanariyobaptiste8177
    @imanariyobaptiste8177 Год назад

    practical explained bro keep it up

    • @deeecode
      @deeecode  9 месяцев назад

      Thank youuu

  • @marypaul9627
    @marypaul9627 5 месяцев назад

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

    • @deeecode
      @deeecode  3 месяца назад

      I’m so glad to hear ✨

  • @archonarchon6613
    @archonarchon6613 5 месяцев назад

    wow nice explanation👍👍👍

    • @deeecode
      @deeecode  5 месяцев назад

      I'm so glad you enjoyed it ;)

  • @CecíliaCastrodosSantos
    @CecíliaCastrodosSantos Год назад

    very nice

    • @deeecode
      @deeecode  9 месяцев назад

      you're welcome

  • @TEJASSADADE
    @TEJASSADADE Год назад

    love from india

  • @enibondarenko1233
    @enibondarenko1233 Год назад

    super helpful

  • @vikitalk
    @vikitalk Год назад

    thanks sir

    • @deeecode
      @deeecode  11 месяцев назад

      Most welcome

  • @hexgrade177
    @hexgrade177 Год назад

    W tutorial

    • @deeecode
      @deeecode  Год назад

      Nice to know. Thank you

  • @therobber
    @therobber Год назад

    Amazing

  • @bananabread6758
    @bananabread6758 Год назад

    very good

  • @mnnw148
    @mnnw148 Год назад

    Great 😊

    • @deeecode
      @deeecode  9 месяцев назад

      You're welcome

  • @BSITVinluanEner
    @BSITVinluanEner Год назад

    Thaks bro

  • @mariopizzaro
    @mariopizzaro Год назад

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

    • @deeecode
      @deeecode  Год назад

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

  • @JhonLogix
    @JhonLogix Год назад

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

    • @deeecode
      @deeecode  Год назад +1

      Glad you liked it! You're welcome

  • @davidezih3510
    @davidezih3510 Год назад

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

    • @deeecode
      @deeecode  Год назад +1

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

  • @CLeovison
    @CLeovison Год назад

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

    • @deeecode
      @deeecode  Год назад

      You're welcome! So glad to hear

  • @cescr3821
    @cescr3821 Год назад

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

    • @deeecode
      @deeecode  Год назад +2

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

    • @avalonstudio2753
      @avalonstudio2753 Год назад

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

  • @MatheusPereira-nn9dj
    @MatheusPereira-nn9dj Год назад

    Awsome content 🔥

  • @marielfigueroacolmenares1869
    @marielfigueroacolmenares1869 Год назад

    Clarísimo, gracias!!

  • @iamvictorjack
    @iamvictorjack 11 месяцев назад

    Explanation is clean but I’m still confused 🥲

    • @deeecode
      @deeecode  11 месяцев назад

      Hi, In what way are you confused? 🤔