HTMLCollection vs. NodeList Explained!

แชร์
ฝัง
  • เผยแพร่เมื่อ 6 ก.ย. 2024
  • An exploration and comparison of HTMLCollections and NodeLists. HTMLCollections and NodeLists are different types of collections that contain DOM elements or nodes. An HTMLCollection or NodeList is what gets returned when we use various JavaScript selector methods like getElementsByTagName, getElementsByClassName, querySelectorAll, etc. By understanding the differences between HTMLCollections and NodeLists we can better decide which selector methods to use. Created by Gregg Fine.
    📖 Download my FREE "Google Search Secrets for Developers" Cheat Sheet:
    store.thecodec...
    🗣JOIN the Code Creative Facebook group! :
    / 1612600368887577
    🔴Subscribe for more free Code Creative videos: : / @thecodecreative
    🌐 The Code Creative Official Website
    www.thecodecre...
    🎓 The Code Creative Courses
    www.thecodecre...
    ✅ Recommended related videos:
    Debouncing Explained
    • Debouncing Explained |...
    Memoization Explained
    • JavaScript Memoization...
    Sorting in JavaScript Explained
    • JavaScript Comparator ...
    ✅ For business inquiries contact me at gregg@greggfinedev.com
    ✅ Let's connect:
    Twitter - @GreggFine
    Instagram - /greggfinedev
    Facebook - /hiddentigermusic

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

  • @fmri4301
    @fmri4301 4 ปีที่แล้ว +7

    This is the first video of HTMLCollection vs nodeList which was actually useful. Although the the implementation of Live vs Static is still weird for me... I mean static collection still update the DOM ...

    • @TheCodeCreative
      @TheCodeCreative  4 ปีที่แล้ว

      Hi fMRI, glad it was useful! Let me know what was confusing to you about Live vs. Static. Can you give an example of a static collection updating the DOM?

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

      @@TheCodeCreative Actually all was very clear. However, a lot of articles tell you HTMLCollection = Live and NodeList = Static, which is true in most cases but then there is .childNodes which is a NodeList but also Live...

    • @TheCodeCreative
      @TheCodeCreative  4 ปีที่แล้ว

      @@fmri4301 ah, I see what you're saying. Yes, that definitely is confusing to remember! :-)

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

    Man you saved me from a mental breakdown, I was so confused as to why I couldn't apply array methods using querySelector
    Thank you very much, it clarifies a lot about how to select the elements from the DOM!

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

    thank for your useful video. Could you give us some examples when should use both?

  • @mahaan6218
    @mahaan6218 4 ปีที่แล้ว +5

    Wow! Best video on the topic I've ever seen. Please continue uploading more vids like this one. We love to see them. Liked and Subbed :P

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

    Was getting confused how nodeList was being accessed with index and forEach. Cleared me up. Thanks!

    • @TheCodeCreative
      @TheCodeCreative  4 ปีที่แล้ว

      Glad to hear. Thanks for watching Utsav!

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

    Excellent explanation. Put me on the right road.

  • @drkunivrs
    @drkunivrs 2 หลายเดือนก่อน +1

    Thanks for the explanation, it's been very helpful!

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

    Man seriously, you saved my life! Thanks alot!

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

    Thanks sir
    Just wanted to point out that in array.from the second arguement is the map method so you didnt need to explicitly use the map

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

      That's really cool! I'm gonna use that all the time now 😀

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

    Super clear and precise

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

    man, you deserve heart and support i love your explanation brooo thanks !

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

    Thanks I'm from Argentina and I understood

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

    completely helpful. Thank you for such a self-explanatory content.

  • @samadkhan-ch1bx
    @samadkhan-ch1bx 2 ปีที่แล้ว +1

    A very Nice and Helpful Video👍👍

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

    Thanks man it helped me to understand pros and cons

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

    Thank you for explaining it so clearly. Subscribed!

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

    Thank you. 🙏And for listing the other node type! I was a bit confused but not after watching this.

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

    Excellent! I'm going to watch all of your videos.

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

    Thanks Sir... What needed

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

    this video is completely helpful. now I can understand the difference, keep going to do more videos❤

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

    Thank you so much i loved your teaching 🙏🏻

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

    nice illustrated recap 👍

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

    very helpful! thank you for your explanation

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

    Best video on the topic I've ever see

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

    Very useful video. Thank you

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

    awesome video! very informative . Easy to follow example to demonstrate a confusing topic. Well done!

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

    Thank u man .. You are a life saver

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

    Late to the party but thanks for the excellent explanation

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

    Great Video. It helped me a lot.

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

    Very helpful thanks!

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

    Very useful!

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

    This video was great

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

    Thank you . I am grateful for your help.

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

    grateful for such a clear explanation, like+sub

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

    Good job, everything is clear. I like your channel, there are a lot of useful videos! thx

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

    Great thanks!

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

    good video

  • @TheCodeCreative
    @TheCodeCreative  4 ปีที่แล้ว

    🗣JOIN the Code Creative Facebook group! :
    facebook.com/groups/1612600368887577

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

    great video

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

    fantastico!

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

    Thank you so much for this video, god bless you sir

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

    Thank you

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

    📖 Download my FREE "Google Search Secrets for Developers" Cheat Sheet:
    store.thecodecreative.com/google-secrets-cheat-sheet

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

    which skin of vsc?

  • @TheCodeCreative
    @TheCodeCreative  4 ปีที่แล้ว

    To subscribe to the channel: th-cam.com/channels/mOpHGj4JRWCdXhllVTZCVw.html

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

    ❤️❤️❤️👍👍👍thank you

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

      You're welcome, thanks for watching!

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

    I have a feeling that you edited this video on a linux box

  • @AhmedIbrahim-fi2so
    @AhmedIbrahim-fi2so 2 ปีที่แล้ว

    dud that is so confusing 😩😩😩

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

      Is there anything in particular that you found confusing?

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

    well explained. thank you!🙏