JavaScript Event Capture, Propagation and Bubbling -

Поделиться
HTML-код
  • Опубликовано: 4 ноя 2024

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

  • @tigana
    @tigana 2 года назад +559

    If you’re here from The Odin Project, keep up the good work:) I’m rooting for you

    • @ibenachoelvis4919
      @ibenachoelvis4919 2 года назад

      Yeah @ Tigana

    • @junhaoong941
      @junhaoong941 2 года назад +2

      thanks hahahah

    • @stevenson1142
      @stevenson1142 2 года назад +3

      lets go brandon

    • @ngndnd
      @ngndnd Год назад +6

      im so confused... even with the previous assignments. He goes too fast and doesnt explain why hes doing what he does

    • @syedfaheem1185
      @syedfaheem1185 Год назад +6

      @@ngndnd don't go too fast and slow down the pace at which you are learning stuff. Just get acquainted with the stuff before moving on to the next course.

  • @PatrikRasch
    @PatrikRasch 2 года назад +352

    Great job on this series, very helpful.
    The Odin Project brought me here!:) - Foundations: DOM Manipulation and Events

    • @RustysAdventures
      @RustysAdventures 2 года назад +19

      Here for the same reason. Let's gooo!

    • @ganyrehs
      @ganyrehs 2 года назад +22

      I started Odin Project mid Feb 2022 and got to working with DOM manipulation this week of March 12, 2022. It's been a good experience so far compared to classes that I've taken in college. lol

    • @achukwuLeke
      @achukwuLeke 2 года назад +11

      Odinites!

    • @tigana
      @tigana 2 года назад +12

      Odin fam!!

    • @nou9225
      @nou9225 2 года назад +14

      Hello fellow TOP students 👋

  • @ebrelus7687
    @ebrelus7687 2 года назад +8

    OP heroes. Forward!
    The additional resources are lethal.
    But repeats are what stick it up for long & targets holes.
    Thanks you bless you.

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

    This is 5 years old and it help me so much today!! thank you!

  • @CoryTheSimmons
    @CoryTheSimmons 7 лет назад +35

    Thanks again Wes! Learning a lot from this series.
    Humble beg: Please cover `this` and context in all its horrible glory. I'm pretty sure a lot of devs have a huge problem thoroughly grokking the concept because there are few resources with real world examples.
    It's especially important to thoroughly understand with React and Vue.

  • @salaheddinemadih5617
    @salaheddinemadih5617 7 месяцев назад +1

    6 years ago and the video is still amazing

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

    This video has something that other videos and guides about bubbling lack - simplicity. it actually looks like an easy concept if creator uses simple examples rather than complex functions in his explanation. Great work, thank you!

  • @jayceyourdreams2062
    @jayceyourdreams2062 Год назад +3

    good luck with the odin project guys!! we will all become aspiring developers one day

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

    Everyone’s here from Odin, I’m here from Lightning Web Components, and you’ve really saved me from all my confusion on events. Gracias!

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

    What a fantastic teacher! I love how Wes is able to break down this material in a succinct and easy to digest manner.

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

    Very clear explanation. These concepts were confusing me but this video really helped me to understand each of them. Thank you Wes!

  • @emilymarin2521
    @emilymarin2521 2 года назад

    Very clear tutorial. I've worked with JS for about a year, but never had to use capture, propagation, or bubbling. This is a succinct and easy to understand lesson. Thanks!

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

    Unlike most of the people here, I'm not from the odin project but this video is one if the best explanations of js I've seen on youtube. Keep the good work

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

    The quality of this video is amazing.

  • @russelldsouza7738
    @russelldsouza7738 16 дней назад

    Great Explanation , TheOdinProject brought me here, Foundations: DOM Manipulation and Events

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

    Crystal clear explanation! Love the pacing. Thank you!

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

    Came here from TOP. Really helpful.

  • @gorilla-san
    @gorilla-san 2 года назад +1

    "But we also clicked on the world"
    that bubblated quickly

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

    Thank you! This was an effective, no-nonsense explanation video

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

    Thank you for the video. Excellent explanation, simple example with explanation of core functionality. Great to understand how events work in JavaScript.

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

    "...and you're also clicking on the world" 😂

  • @Tbone11756
    @Tbone11756 2 года назад +1

    This is a goldmine of information, thanks so much for this!

  • @hellonihaocomoestas
    @hellonihaocomoestas 2 года назад +5

    CITIZENS OF ODIN. How long has it taken you to get from the very first lesson in the course to this one?

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

      9 days, studying an average of +8h a day everyday

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

      3 or 4 weeks on top of university work. I'd done some of a web development course before and have gotten my feet wet in a few other languages, so it went a bit faster than it would have otherwise.
      I think the most important stat over anything is consistency - that you keep going and enjoy what you learn and keep getting more exposure to concepts.
      It's easy to speed run and then burn out or just never get going. Consistency is what gets you there though!

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

      3-4 months, but I'm workingfull time and study about an hour a day after work and 3-5 hours weekend days

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

      2-3 Months for Me, im working fulltime as well but I hammer about 15 hours a week.

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

    well explained from the first 3 mintutes. Very straight to the pain. Thanks

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

    4:57 if you would like to know the general area where it goes over what "capture" is. I know the RUclips player already references it as the "most replayed" area, but just in case people need it.. GL fellow TOP students!

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

    Wes Bos and TOP are the two best resources out there for learning web development

  • @bhuwanpandey4342
    @bhuwanpandey4342 3 года назад +1

    This is excellent explanation Wes Bos, but with capture true, isn't e.stopPropagation() means stop capturing and not stop bubbling

  • @zmonk901
    @zmonk901 3 года назад +1

    Great job Wes. Thank you for sharing.

  • @samueljefferies2023
    @samueljefferies2023 2 года назад +8

    Good, but blisteringly fast! Hopefully I can learn more so I can keep up with the pace.

  • @djlee0721
    @djlee0721 4 года назад +3

    Wow.. finally understood everything. Thank you so much!

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

    Thanks for the explanation!

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

    Awesome example. Thanks!

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

    God bless the contributors of the odin project.

  • @ParkBosuk
    @ParkBosuk 2 года назад

    Thank you. Your lessons were very helpful.

  • @rtemmiroshnichenko6733
    @rtemmiroshnichenko6733 7 лет назад +2

    Damn, this one is very useful! Thank you for videos. Great job !

  • @harunguven8581
    @harunguven8581 3 года назад +1

    Thank Wes, "I clicked on the world 🌎🌍 😃", this made my day😄.

  • @abdullahimohammedhussain3382
    @abdullahimohammedhussain3382 9 месяцев назад +2

    Odin peeps. Say Hi

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

    Hello! Great video and series. I'm curious - how do you disable a whole line of code with one action as I've seen you do with a shortcut many times? I haven't been able to find out how anywhere!

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

      Shift Command Right Arrow (To select whole line) the press Command Forward Slash

  • @pritamaries
    @pritamaries 3 года назад +1

    Very well explained !! Thanks a lot Wes

    • @WesBos
      @WesBos  3 года назад

      Glad it was helpful!

    • @DragonWhisky
      @DragonWhisky 3 года назад +1

      ​@@WesBos Thank you for this video. It is very helpful and helps me understand why my code works (I somehow used 'this' and it works... and this explains me why) :D

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

    excellent. thank you so much.

  • @MVIVN
    @MVIVN 2 года назад

    I'm really struggling. I think I need to go right back to square one and try again. Can't follow what's going on.

  • @fanwilliam7725
    @fanwilliam7725 2 года назад +1

    I tried to click on the area where only is sitting on, I was expecting the console to return three, two and one. But the console only return "one". Which is confusing because I thought Java Script is going to capture "downward" to record all children element of .

    • @ucf.christopher
      @ucf.christopher Год назад

      When you click on ".three", it is sitting inside of ".two", which is sitting inside of ".one". So by clicking the third div, you are also selecting the other divs automatically. If you click on div one, you are only selecting div one.

  • @vamsikumarreddypalugula7460
    @vamsikumarreddypalugula7460 6 лет назад +1

    Hey hi,
    In the case of stopPropagation and capture:true when we click on any of the div's the event should terminate as soon as it is triggered (on the window itself) but its getting terminated at first div (class="one") always. It makes sense as it(one) is the parent of all but behind the scenes everything comes from DOM right so it has to terminate at window and show us nothing when we click as we did not assign any class to it .

    • @loia5tqd001
      @loia5tqd001 4 года назад +3

      and don't have any event handler with e.stopPropagation(), so it'd only stop at .one, because .one is the first one that delibarately said it to "stop propagating" the event

  • @kresimircosic3753
    @kresimircosic3753 5 лет назад +1

    Good explanation, thanks my man.

  • @djfoo000
    @djfoo000 2 года назад

    for the following setting:
    propagation: true (for simplicity)
    capture: false
    once: true
    I'm still getting the parents logged as being clicked in subsequent clicks. The console logs the following with the above:
    three (after first click)
    two (after 2nd click)
    one (after 3rd click)
    (no more logs after 4th click)
    Is there a way to only log the element being clicked? In other words, ignore the parent, and any childs.

  • @realmumptastic
    @realmumptastic 7 лет назад +1

    Awesome video as always.

  • @tramarthomas6105
    @tramarthomas6105 3 года назад

    Amazing explanation

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

    If you're here from The Odin Project just dont lose hope you can do it

  • @mirage4731
    @mirage4731 3 года назад

    amazing explanation, thank wes Bos

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

    I'm here from The Odin Project. At 7:04 when I have capture: true and e.stopPropagation(); and click on the outer div of class .one I get 'bod' in the console, not 'one' Why would this happen? Please help.

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

      That's OK, it's a syntax snafu on my part. 🙂

  • @bjorn5328
    @bjorn5328 2 года назад

    I don't know why but when am using an arrow function to console.log(this) on 1:10 am getting a windows object ?can someone pls help me understand why am getting that output.Thanks!

  • @jamochl
    @jamochl 4 года назад

    Awesome! Thank you!

  • @Sdirimohamedsalah
    @Sdirimohamedsalah 2 года назад

    Excellent

  • @alvarobyrne
    @alvarobyrne 7 лет назад

    Hi. Great video as aLl of yours. Would you please do/make a video explaining how to properly remove event listeners. Thanks in advance

  • @imranshaikh115
    @imranshaikh115 4 года назад

    Awesome Wes :)

  • @RodriguezEdwin1324
    @RodriguezEdwin1324 4 года назад

    great tutorial :)

  • @benosonline
    @benosonline 2 года назад

    thanks bud

  • @Alexandre_Keo
    @Alexandre_Keo 8 месяцев назад

    The Odin Project students, Assemble!

  • @mrmusculo499
    @mrmusculo499 Год назад +3

    odin project

  • @alirezafazeli231
    @alirezafazeli231 3 года назад

    That's Awesome

  • @taihatranduc8613
    @taihatranduc8613 2 года назад

    thank you

  • @ousmand742
    @ousmand742 4 года назад

    i wish there was a codepen

    • @ManojKumar-op7ot
      @ManojKumar-op7ot 4 года назад

      If you can make use of this: github.com/wesbos/JavaScript30

  • @shshawon39
    @shshawon39 4 года назад

    Great

  • @vahanpetrosyan3773
    @vahanpetrosyan3773 6 лет назад +1

    Please mention that you use your code in footer below the DIVs in html and querySelectorAll is not 'live' so if used in head section above it will not work since divs don't exist at the time of calling this function

  • @isurumdev
    @isurumdev 7 лет назад

    What is that IDE?

    • @OkanEsen
      @OkanEsen 7 лет назад

      Looks like WebStorm from JetBrains.

    • @FunnyPaplo
      @FunnyPaplo 7 лет назад

      sublime text 3 + custom font

    • @rammyramkumar
      @rammyramkumar 7 лет назад +1

      Sublime text + custom cobalt theme + operator mono font

    • @ufotofu9
      @ufotofu9 5 лет назад

      @@OkanEsen not even close

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

    didn't mean to click on the world 😅

  • @ammarcopelj6747
    @ammarcopelj6747 8 месяцев назад

    we click on universe...hahahhahahaha

  • @deivi3697
    @deivi3697 2 года назад

    JavaScript is casesensitive :d lol