Learn DOM Navigation in 15 minutes! 🧭

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

КОМЕНТАРІ • 19

  • @BroCodez
    @BroCodez  Рік тому +4

    // DOM Navigation = The process of navigating through the structure
    // of an HTML document using JavaScript.
    // .firstElementChild
    // .lastElementChild
    // .nextElementSibling
    // .previousElementSibling
    // .parentElement
    // .children
    // ---------- .firstElementChild ----------
    const ulElements = document.querySelectorAll("ul");
    ulElements.forEach(ulElement => {
    const firstChild = ulElement.firstElementChild;
    firstChild.style.backgroundColor = "yellow";
    });
    // ---------- .lastElementChild ----------
    const ulElements = document.querySelectorAll("ul");
    ulElements.forEach(ulElement => {
    const lastChild = ulElement.lastElementChild;
    lastChild.style.backgroundColor = "yellow";
    });
    // ---------- .nextElementSibling ----------
    const element = document.getElementById("vegetables");
    const nextSibling = element.nextElementSibling;
    nextSibling.style.backgroundColor = "yellow";
    // ---------- .previousElementSibling ----------
    const element = document.getElementById("desserts");
    const prevSibling = element.previousElementSibling;
    prevSibling.style.backgroundColor = "yellow";
    // ---------- .parentElement ----------
    const element = document.getElementById("ice cream");
    const parent = element.parentElement;
    parent.style.backgroundColor = "yellow";
    // ---------- .children ----------
    const element = document.getElementById("fruits");
    const children = element.children;
    Array.from(children).forEach(child => {
    child.style.backgroundColor = "yellow";
    });

  • @kosovaR7
    @kosovaR7 11 місяців тому +4

    You have been tremendously helpfull during my learning journey in my bootcamp. Thank you so much!

  • @zappmen
    @zappmen 11 місяців тому

    ahh finally, i watching all of your new js playlist its helpful to get me understanding js can't wait for the next content. Thank you bro😁🎉

  • @MulusewWase-r7b
    @MulusewWase-r7b 3 місяці тому

    Thank you so much!! I have not words dear.

  • @shafiq_ramli
    @shafiq_ramli Рік тому +5

    I still don't get it why I don't see your uploaded videos on my subscription feed.
    What's wrong with my UA-cam account?

    • @whatevero3701
      @whatevero3701 Рік тому +5

      Hes pressing the button to hide all videos from subscribers you're welcum

  • @darkslopegaming6855
    @darkslopegaming6855 Рік тому +4

    Hey Bro Code, I really enjoy your videos and I have learnt a ton from you! I was wondering if you had a patreon page or a donation page or something, cause I really want to support you!

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

      He supports St. Jude hospital in some of his videos so you could donate there, would be a nice act

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

      @@hunin27 Oh..okay thank you.

  • @xzex2609
    @xzex2609 11 місяців тому

    Bro I see that you select your line to copy it on the new line , VS Code has this very useful key command that wiothout selecting duplicates the current line it's ALT+SHIFT +D i really am addicted to this way

  • @JarvisBaileyVA
    @JarvisBaileyVA Рік тому +2

    How did you know I was having this exact lesson TODAY?

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

    Does anyone know when he will release the full course?

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

    Can u tutorial VueJs!? Full course 👌

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

    Bro, make tutorial for libgdx java

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

    hey bro code how about "asm" full course?

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

      Lol hell never publish that, that language is hard as hell

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

    Flutter course please BRO🎉🎉🎉🎉

  • @harshjaiswal1634
    @harshjaiswal1634 11 місяців тому

    Bro continue the series.

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

    Bro TypeScript...