Event Handlers vs Event Listeners in JavaScript 👨‍💻💯

แชร์
ฝัง
  • เผยแพร่เมื่อ 25 ส.ค. 2024

ความคิดเห็น • 52

  • @rocdiva530
    @rocdiva530 7 หลายเดือนก่อน +5

    I’m new to JavaScript and I kept hearing my teacher talk about event handler, event listener and I couldn’t decipher one from the other. This video is just what I needed. THANK YOU!

  • @Ifeomaa
    @Ifeomaa 8 หลายเดือนก่อน +4

    Short and straight to the point, learnt helpful tips

  • @nitkarshchourasia2406
    @nitkarshchourasia2406 4 หลายเดือนก่อน

    🎯 Key Takeaways for quick navigation:
    00:00 *🎶 Introduction to Event Handling in JavaScript*
    - Understanding the difference between event handlers and event listeners in JavaScript.
    - Overview of handling events using event handlers and event listeners.
    00:30 *🖱️ Event Handlers in JavaScript*
    - Event handlers are properties of objects used to handle events.
    - Demonstrating event handling with an example of using the `onclick` event handler.
    - Limitation of event handlers: only one event handler for a specific event type.
    01:51 *🔊 Event Listeners in JavaScript*
    - Event listeners are assigned to objects to listen for events and execute code accordingly.
    - Example of using the `addEventListener` method to handle click events.
    - Advantage of event listeners: ability to add multiple listeners for the same event.
    03:41 *🔃 Comparison: Event Handlers vs. Event Listeners*
    - Experimenting with adding multiple event handlers and event listeners to understand their behavior.
    - Demonstration of the difference in behavior when adding multiple handlers/listeners.
    - General advice: prefer event listeners over event handlers for flexibility and scalability.
    Made with HARPA AI

  • @Jaycoda10
    @Jaycoda10 ปีที่แล้ว +9

    brilliant just what I was looking for, simple and straight to the point, boom!

  • @kaanergunlu7836
    @kaanergunlu7836 2 ปีที่แล้ว +4

    Well explained with clear examples, appreciated!

  • @darrienjohnson9053
    @darrienjohnson9053 2 ปีที่แล้ว +7

    Thanks. This was simple and easy to understand appreciate it bro

  • @sahanatelasng8812
    @sahanatelasng8812 2 ปีที่แล้ว +1

    Really this video gave me a solution for my problem .... U are the best ... U solved it within few seconds .... In easy way..

  • @therealspaceman3447
    @therealspaceman3447 11 หลายเดือนก่อน +1

    This was a very useful video for me. I had previously wrapped button and such with divs to support two events at once. No more. Thank you.

  • @edwinlimo5354
    @edwinlimo5354 ปีที่แล้ว +1

    Great Patrick, your explanations are easy to understand

  • @bigshuff
    @bigshuff ปีที่แล้ว +1

    Thank you for making this subject so easy to understand, I am so glad I persevered with my search and found you.

  • @saravananarumugam1702
    @saravananarumugam1702 3 หลายเดือนก่อน

    Thanks for explaining ❤

  • @essenzoffiziell8421
    @essenzoffiziell8421 10 หลายเดือนก่อน

    thank you for your video... God Bless You with The Best All Things

  • @hajimeippo804
    @hajimeippo804 3 ปีที่แล้ว +1

    thank you ..this is the best explanation about difference between handler and listener. .I was confused about them very much. ....Subscribed 👍

  • @Zen-lz1hc
    @Zen-lz1hc 2 ปีที่แล้ว +1

    Like
    Thanks for the clear explication.

  • @aamir067
    @aamir067 ปีที่แล้ว

    thanks buddy. you really solved my confusion about event handler and listener.

  • @marky1756
    @marky1756 2 ปีที่แล้ว +1

    Now I understand. Thanks a lot.👍

  • @Prabh_cc
    @Prabh_cc 10 หลายเดือนก่อน

    Helpful content❤❤❤, I'm glad that you are doing something useful😊

  • @djfago6240
    @djfago6240 ปีที่แล้ว

    Brilliant explanation. Thank you bro

  • @reithmkil1168
    @reithmkil1168 11 หลายเดือนก่อน

    Bro thank you for this video, perfect explanation

  • @sip6963
    @sip6963 2 ปีที่แล้ว

    Great video! Solved my doubt of 2hrs research. Kudos!

  • @sunyfilip
    @sunyfilip 10 หลายเดือนก่อน +6

    But you need to be careful if you are assigning those listeners dynamically....if you for example open dialog with that element again and you are assigning those listeners again, you will have all your listeners runned multiple times, so don't forget to remove listeners before taking your element away :)

  • @bluin666
    @bluin666 2 ปีที่แล้ว

    thx. that was pretty easy to understand

  • @ScottIngram
    @ScottIngram 10 หลายเดือนก่อน

    Thank you. Very clear.

  • @yuriinadilnyi3029
    @yuriinadilnyi3029 ปีที่แล้ว +1

    I'd like to add that using EventListener allows you to add additional options if it's needed, cuz Im not sure if handlers do the same staff

  • @offgridvince
    @offgridvince ปีที่แล้ว +1

    Thanks

  • @philipparker113
    @philipparker113 ปีที่แล้ว

    Thanks. Its very clear now.

  • @passionatechristianmaker
    @passionatechristianmaker ปีที่แล้ว

    Great video, at work i hear these terms all the time but didn't get them initially

  • @blueberry5992
    @blueberry5992 ปีที่แล้ว

    keep up the great work

  • @GLHD-tl2hl
    @GLHD-tl2hl 4 หลายเดือนก่อน +1

    mind asking what font is this??... Too cool

  • @yabool2001
    @yabool2001 7 หลายเดือนก่อน

    Nice job.

  • @user-ig1tf5bx2e
    @user-ig1tf5bx2e 2 ปีที่แล้ว +1

    Thank you

  • @anarosol6133
    @anarosol6133 11 หลายเดือนก่อน

    Thank you!!

  • @chigurupati_s
    @chigurupati_s 11 หลายเดือนก่อน

    Super bro

  • @JoanManuelSB
    @JoanManuelSB 10 หลายเดือนก่อน

    nice

  • @Escko
    @Escko 10 หลายเดือนก่อน

    thank you

  • @miss_kolissa
    @miss_kolissa 8 หลายเดือนก่อน

    How do you click once & comment 3 different lines at the same time? I'm also just learning a lot of shortcuts in the IDE

  • @japhethachimba174
    @japhethachimba174 2 ปีที่แล้ว

    Thanks for the awesome content, which theme are you using for your VSCODE bro

  • @jackmandu
    @jackmandu 2 ปีที่แล้ว +2

    Is there a preference of which to use if you need to have multiple objects all call the same function? For example I need to have several form fields concatenated into a single field.
    Also, is there anything special that needs to be done with addEventListener depending on the type of input field, such as radio button vs. text vs. select field?

    • @jackmandu
      @jackmandu 11 หลายเดือนก่อน

      The solution I used was to use the generally least preferred option, which is in-line HTML event handler where you can have multiple functions separated by semi-colons, such as onchange=“func1();func2()”.

  • @hajimeippo804
    @hajimeippo804 3 ปีที่แล้ว

    can you please make video about difference between let,const and various and when to use them?

  • @yousef7885
    @yousef7885 2 ปีที่แล้ว

    thank you very much

  • @mahtabvariyani
    @mahtabvariyani ปีที่แล้ว

    thanks

  • @AnilKumar-jx1hk
    @AnilKumar-jx1hk 10 หลายเดือนก่อน

    nice moustache btw

  • @ravisankar9122
    @ravisankar9122 4 หลายเดือนก่อน

    I love you

  • @akashanand2656
    @akashanand2656 8 หลายเดือนก่อน

    What if I use handler and listener at the same time?

  • @محمّد.09
    @محمّد.09 6 หลายเดือนก่อน

    why no one is appreciating his typing sound?

  • @jarawinpromsawat
    @jarawinpromsawat 3 ปีที่แล้ว

    เทพจัดพี่

  • @shivinNirwanYadav
    @shivinNirwanYadav ปีที่แล้ว

    Impress why code typing

  • @oleksandrdemchenko482
    @oleksandrdemchenko482 4 หลายเดือนก่อน

    +

  • @capslock3250
    @capslock3250 10 หลายเดือนก่อน

    Thanks

  • @Anas-ri4vv
    @Anas-ri4vv ปีที่แล้ว

    Thank you