Traversing the DOM with JavaScript

Поделиться
HTML-код
  • Опубликовано: 10 сен 2024
  • Using the Node and Element properties you can search through a web page to find specific elements and their contents.
    Remember that all the Nodes have parent-child relationships to each other. Only Element nodes can be parents. However, depending on the property that you use you can get lists of Elements or lists that include element nodes, text nodes, and comment nodes.

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

  • @AndrewKwabula
    @AndrewKwabula 4 года назад +5

    I searched, "Traversing the Dom" and looked at which one is done by Steve Griffith. Very clear explanation in a very very chilled voice.

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

      veery erotic voice

  • @ga7853
    @ga7853 5 лет назад +2

    I can listen to you hours and hours without an itch, unbelievable way of explaining, you have made for this.

  • @rotrose7531
    @rotrose7531 4 года назад +1

    Thank you very much, I begin to worry that once I learned all your tutorials, what should I do then. I do not want to lose the motivation I gained from your tutorials.

    • @SteveGriffith-Prof3ssorSt3v3
      @SteveGriffith-Prof3ssorSt3v3  4 года назад +2

      Build something. Start simple and add more and more features. You will learn by doing.
      And I will always have more tutorials.

    • @rotrose7531
      @rotrose7531 4 года назад +1

      @@SteveGriffith-Prof3ssorSt3v3 Thank you. I will resume many botched projects after finishing all the tutorials here. Enpowered with your knowlwdge, now feel fit to pick them up again. Thank you.

  • @fuzzl277
    @fuzzl277 6 лет назад +6

    You should upload more of these tutorials, you are amazing at explaining something. Thanks a lot.

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

    You have a gift of teaching, you would make one of the top instructors in udemy!!

  • @groovysalmon6857
    @groovysalmon6857 5 лет назад +2

    Finally, The Bob Ross voice of JavaScript!

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

    Really appreciate your summary down below the video. Also the content value is incredible

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

    Excellent films !

  • @1966fong
    @1966fong 4 года назад +1

    clear and helpful.thanks

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

    Sound like Tony Stark of RDJ, Great Video, Thanks a lot!

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

    2023 still usefull!!

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

    Thank you!!! Very well explained, helped me a lot!!!

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

    Great stuff, mate. Keep on going!

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

    2:48 after the open tag isn't it have 1 character return. I nearly understand about note count, just a little confuse

  • @JohnDoe-sz5jh
    @JohnDoe-sz5jh 5 лет назад +1

    Thank you for your videos Steve. I am trying to append to the text in my links onmouseover and revert onmousout. I am not figure it out or find the information in the documentation.

    • @SteveGriffith-Prof3ssorSt3v3
      @SteveGriffith-Prof3ssorSt3v3  5 лет назад +1

      You would use addEventListener with mouseover and mouseout and then change the textContent property value or maybe create a span with the text which can be appended and removed with appendChild and removeChild.

    • @JohnDoe-sz5jh
      @JohnDoe-sz5jh 5 лет назад +1

      @@SteveGriffith-Prof3ssorSt3v3 thanks man. I do try that. I need to go back and watch JavaScript from the Start playlist to completion as well. I broke away from that to look at this one, as it appertains directly what I'm trying to do.

    • @SteveGriffith-Prof3ssorSt3v3
      @SteveGriffith-Prof3ssorSt3v3  5 лет назад +1

      @@JohnDoe-sz5jh I have a playlist about JavaScript in the browser and another one about Events which would probably be better for things like this.

    • @JohnDoe-sz5jh
      @JohnDoe-sz5jh 5 лет назад +1

      @@SteveGriffith-Prof3ssorSt3v3 Yeah. I'll check them out. I'm putting your examples in in a practice.js file and heavily commenting for reference. I need t get a better understanding of core JavaScript, I think, before I proceed. I have no programming foreknowledge. I'm very recently looking into it.

    • @SteveGriffith-Prof3ssorSt3v3
      @SteveGriffith-Prof3ssorSt3v3  5 лет назад +1

      @@JohnDoe-sz5jh good luck!

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

    Hi @steve griffith
    // node.parentNode
    i want to display element ul
    console.log( firstLi.lis )
    I tried the above but it resulted as : undefined
    please help

    • @SteveGriffith-Prof3ssorSt3v3
      @SteveGriffith-Prof3ssorSt3v3  4 года назад +1

      lis is an array of all the list items, not the parent ul element.
      firstLi.parentNode or firstLi.parentElement will work.

    • @scarface9362
      @scarface9362 4 года назад +1

      @@SteveGriffith-Prof3ssorSt3v3 Thanks steve i was thinking in a wrong direction . u r correction helped me

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

    9:20 Can you please me understand why firstLi.firstChild.nodeValue.toUpperCase(); does not work?

    • @SteveGriffith-Prof3ssorSt3v3
      @SteveGriffith-Prof3ssorSt3v3  3 года назад

      toUppercase( ) returns the uppercase value version of the string. It doesn't change the one in the DOM. You have to assign it. The spelling and capitalization of the method also matter.

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

      ​@@SteveGriffith-Prof3ssorSt3v3 Got it now! Thanks for clarifying these 2 points. BTW, I like your teaching style. I am learning so much from going thru your playlist! THANK YOU for your quality work!

  • @webstuff56
    @webstuff56 6 лет назад

    Nice tutorial; thank you!

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

    Very useful :)

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

    Can you be more specific about the childrenNodes i.e character turn? Like could you highlight with your mouse where they are? I’m a visual learner who needs to see things actually pointed out not just talked about or breezed past. I can’t learn if not shown.

    • @SteveGriffith-Prof3ssorSt3v3
      @SteveGriffith-Prof3ssorSt3v3  5 лет назад +1

      Everything except the html element is a child node. If you take any HTML element, say and put something inside it (another tag OR some text) then you just created a new child node.
      Hello - Hello is the child node
      - is the child node

  • @shinajkurup
    @shinajkurup 6 лет назад

    9:18 didn't get converted to uppercase. Console.log should be at the end of code.

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

    +++