Skip to content

Instantly share code, notes, and snippets.

@YasirGaji
Created December 12, 2021 11:28
Show Gist options
  • Save YasirGaji/27b192ee4da822ef4352ce159686898d to your computer and use it in GitHub Desktop.
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
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