Do You Know The Difference?

Поділитися
Вставка
  • Опубліковано 15 лис 2024

КОМЕНТАРІ • 92

  • @DilanDog
    @DilanDog 3 роки тому +4

    This guy is born to be a teacher and mentor

  • @sidthetech7623
    @sidthetech7623 3 роки тому +24

    The thing I like about Kyle's CSS tutorials is he always does it with style.

  • @SuboptimalEng
    @SuboptimalEng 3 роки тому +148

    What Kyle teaches: CSS styling
    What I want to learn: Hair styling

  • @Stevie1derson
    @Stevie1derson 3 роки тому +24

    Tip to use Array methods on dom elements from document.querySelectorAll()
    1) Array.from(document.querySelectorAll(“element”))
    2) […document.querySelectorAll(“.selector”)]

  • @programmingforfun4158
    @programmingforfun4158 Рік тому +1

    You are genious bro. Instead of focusing on just basic things you always dive deeper.

  • @fabaladibbasey7453
    @fabaladibbasey7453 3 роки тому +47

    Also Nodelist can easily be converted into array with spread operator to be able to have all JavaScript array method functionality

  • @m4m205
    @m4m205 3 роки тому

    You just save my life.
    I am working on a project and I need to understand this.
    Thank you.

  • @talatkuyuk6556
    @talatkuyuk6556 3 роки тому +1

    This was my pain, could not understand the weird behavior of the nodes and elements. Thank you very much, now I understand.

  • @codlover1468
    @codlover1468 2 роки тому +3

    You are awesome brother. You clear all my doubt. Love from 🇮🇳

  • @connorallen162
    @connorallen162 3 роки тому +7

    Super helpful! this was such a mystery to me.
    Though I see why direct DOM manipulation isn't exactly encouraged for beginners, this kind of operation could really use a framework to make it more maintainable and scalable!

  • @AustinThomasFilms
    @AustinThomasFilms Рік тому

    I found this on your website and came to UA-cam to give you a like. Super helpful!!!! This cleared up a lot

  • @DarkSomaX
    @DarkSomaX 2 роки тому +1

    Thank you so much, I was breaking my head trying to understand the differences between the nodes and the elements and how they work 🙃

  • @oldclient
    @oldclient 3 роки тому

    Very informative. First time I noticed the difference between these DOM methods when I worked with , and nodes in a project.
    You have to notice that Node also is handling attributes and other DOM types. Therefore, the nodeType of a Node has these values: 1 (element), 2 (attribute), 3 (text) and more... Nine or ten in total currently.

  • @gopalloharnew5948
    @gopalloharnew5948 2 роки тому +1

    Kyle don't use any vscode theme but still he customizes it a lot which we cannot see directly !

  • @tomraaff4576
    @tomraaff4576 3 роки тому +2

    you can use instanceof to see if a node is an HTML element. It makes working with nodes easier.
    ie.
    if (node instanceof HTMLElement) { node.innerText = 'this is an html element' }

  • @sereneabrahammathew9738
    @sereneabrahammathew9738 3 роки тому +3

    That info on live updates is really useful 🙂

    • @dave6012
      @dave6012 3 роки тому +2

      Yup, can’t say how many times I’ve redefined the same query selector inside functions for dynamic content. Now I know I can keep just one definition in the global scope to get the updates.

  • @karthicksj1936
    @karthicksj1936 3 роки тому +2

    Thank you Kyle for giving this cheat sheet.Your teaching is also awesome 👌👌

  • @talhaibnemahmud
    @talhaibnemahmud 3 роки тому +3

    Extremely helpful video ❤️

  • @pierre3639
    @pierre3639 10 місяців тому

    Awesome! Well explained and simplified

  • @Enes-ik4bm
    @Enes-ik4bm 2 роки тому

    Thank you for videos. Love from Turkey 🙂

  • @raven.4815
    @raven.4815 Рік тому

    Can't thank you enough for this! You really saved me from a couple of headaches lol

  • @akash-m8g6p
    @akash-m8g6p 2 місяці тому

    I lost you at Element. Thanks for sharing

  • @nsharma4981
    @nsharma4981 3 роки тому

    Only you can demystify the most cryptic of JavaScript's intricacies in such an easily understandable manner within 9 minutes, Kyle! This was really helpful! :)

  • @alexmercer8984
    @alexmercer8984 2 роки тому

    Bro, I absolutely Love this video!

  • @johnnypark5398
    @johnnypark5398 Рік тому

    Super well explained. thank you!

  • @arulmuruganK94
    @arulmuruganK94 3 роки тому +4

    I always had doubts when it comes HTML node and element

  • @justanotherhotguy
    @justanotherhotguy 3 роки тому +1

    Learned something new today, thank you!

  • @dave6012
    @dave6012 3 роки тому

    Shedding light on the dark corners 🙌

  • @bayasahamed1815
    @bayasahamed1815 Рік тому

    Thanks for this video and clear explanation.

  • @YaseenAli08
    @YaseenAli08 2 роки тому

    thanks alot, kyle your tips and teachings are very informative and helpful.

  • @HarshKapadia
    @HarshKapadia 3 роки тому

    Wow! AMAZING video Kyle!

  • @MrTomro
    @MrTomro 3 роки тому

    i had no idea about the live update thing. ty

  • @franciswayungi3519
    @franciswayungi3519 3 роки тому

    Thank you very much Kyle for your detailed explanations.

  • @deepaknegi4385
    @deepaknegi4385 2 роки тому

    Awesome information, thanks for sharing

  • @naveedalirehmani4135
    @naveedalirehmani4135 2 роки тому

    Thank you Kyle, Thank you very much!

  • @vahidseyidov
    @vahidseyidov Рік тому

    Thanks for all man

  • @Stormpaw
    @Stormpaw 2 роки тому

    Thanks, that video helped a lot!

  • @realfranciscohermida
    @realfranciscohermida 3 роки тому +6

    Couldn't you easily convert either type of collection to arrays and not have to deal with live updates if that is not desired?

  • @milanpavlovic8141
    @milanpavlovic8141 Рік тому

    This helped me soo much

  • @bones_twisting_sorrow4750
    @bones_twisting_sorrow4750 3 роки тому

    Great explainer, thank you Kyle.

  • @bevik12
    @bevik12 3 роки тому

    Can we get a collection of your cheat sheets Kyle? Pleeease!

  • @srinik9999
    @srinik9999 3 роки тому +29

    I thought it's Node JS vs Someother New technology like Nodejs. 😂

  • @suryapratapsingh5149
    @suryapratapsingh5149 3 роки тому

    Please cover advance concepts of ES6 and ES7

  • @asagex
    @asagex 3 роки тому +1

    Before I watch… my guess is that nodes refer to anything while element refers to just tag based ones. Element would exclude text nodes and such
    Edit: despite my poor wording, I appear to be correct. Sweeeeeeet

  • @hartztech8098
    @hartztech8098 3 роки тому

    Great to reason for selecting because HTMLCollection its update automatically, When we selected sometime we don't want to update selecting further that we required.

  • @michaeleke3913
    @michaeleke3913 3 роки тому

    Great Video...learnt alot!

  • @tomasgilamoedo8301
    @tomasgilamoedo8301 2 роки тому

    Great content! thank bro

  • @geforcesong
    @geforcesong 3 роки тому

    That's a good point. thanks!

  • @yaseenlakhdhar6090
    @yaseenlakhdhar6090 3 роки тому

    Awesome Kyle thanks!

  • @AsakuraAvan
    @AsakuraAvan 2 роки тому +2

    So a node is a superset of an element? Every element is a node but not every node is an element?

  • @ינוןאלבז-כ1ז
    @ינוןאלבז-כ1ז 3 роки тому

    I ask this my self a long time. Now i gonna figure it

  • @raymondyoo5461
    @raymondyoo5461 3 роки тому

    great video thanks a lot for your tip

  • @gopalloharnew5948
    @gopalloharnew5948 2 роки тому

    oOo that's why you prefer querySelector instead of getElementsByClassName !

  • @PerfectionOfError
    @PerfectionOfError 3 роки тому

    Learned something new!

  • @tinmank
    @tinmank 3 роки тому +1

    I've got four consecutive notifications this video, its like youtube trying to get an answer for you.
    do you but do you?

  • @vatsalyasinghi438
    @vatsalyasinghi438 3 роки тому

    Please do a tutorial on next js..

  • @shwackthenoobsac
    @shwackthenoobsac 2 роки тому

    Great content

  • @zenlogie9310
    @zenlogie9310 3 роки тому +2

    but Kyle, why would we wanna have a static list that doesn't live-update ??

  • @Pacvalham
    @Pacvalham 3 роки тому

    Does this prevent live updates?
    const parents = Object.freeze(document.getElementsByClassName('parent'))

  • @윤지만-w4m
    @윤지만-w4m 3 роки тому

    super awesome

  • @Shuyinz
    @Shuyinz 3 роки тому +1

    I didn't get it. Why would you prefer static over live update on HTML? I can't see any real case scenario where it would be harder to debug?

    • @mhombach3035
      @mhombach3035 3 роки тому

      That was my question too, but I guess that in bigger projects you never know what sideeffects are triggered by calling some function. And let's say you are iteration through the "live updated list" with a for-loop and you are creating a const before that loop and store the list's length in there, then the iteration is faulty if some new element is added inbetween, because the for-loop won't reach the end of the array since it changed length.
      I guess it's not "bad practice" to use either, you just have to be knowing what you want to do, what things are happening inside your app and then decide for the best method :)

    • @Shuyinz
      @Shuyinz 3 роки тому

      @@mhombach3035 Sounds very reasonable! Great! Thanks for sharing! :)

  • @alexmahone501
    @alexmahone501 3 роки тому

    Beast

  • @batuhanunal9380
    @batuhanunal9380 Рік тому

    wonderfull

  • @funnyclipsmsda
    @funnyclipsmsda 3 роки тому

    I have a request for a video. I do HTML, CSS and JS coding. For one of my projects, I require a custom scrollbar. I know how to make one, but the conventional ::-webkit scrollbars aren't as customizable as I'd like. What I'm looking for is to replace the scrollbar with a div, so that you have to drag the div to scroll, not the scrollbar thumb. Please help me, I haven't found a solution online yet.

    • @smilo_don
      @smilo_don 3 роки тому

      One way would be to make the div draggable then use the ondrag event to calculate a position and scroll to it using window.scrollTo but it can be dragged both horizontally and vertically so you would have to lock it to only one.

  • @SanjeevKumar-fi1kt
    @SanjeevKumar-fi1kt 3 роки тому

    Hlo sir I need ur help... how can I contact u?

  • @Arabian_Abomination
    @Arabian_Abomination 3 роки тому

    4th

  • @trentreimer130
    @trentreimer130 3 роки тому

    I'm more inclined to listen to someone who plays a Jackson.

  • @mohammedelhadididi4612
    @mohammedelhadididi4612 3 роки тому +1

    First comment , I know that's dumb but...😂