Created
December 12, 2021 11:28
-
-
Save YasirGaji/27b192ee4da822ef4352ce159686898d to your computer and use it in GitHub Desktop.
This gist indicates the betterment of the ".children" method over ".childNodes" method to call an element's child or children its further explained in the DOD article by Yasir Gaji
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let val; // initilizing alpha variable | |
const list = document.querySelector('ul.showcase'); // assigning sub variable "list" to the ul in the html collection | |
val = list.children; // HERE THE METHOD "children" IS ASSIGNED TO THE "list" VARIABLE TO GET IT'S CHILDREN | |
console.log(val); // calling the alpha variable |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment