Skip to content

Instantly share code, notes, and snippets.

@YasirGaji
Last active December 12, 2021 12:41
Show Gist options
  • Save YasirGaji/2b0826d887b4bfeec3c911da3776a719 to your computer and use it in GitHub Desktop.
Save YasirGaji/2b0826d887b4bfeec3c911da3776a719 to your computer and use it in GitHub Desktop.
This gist indicates how to call child nodes of an element 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.childNodes; // HERE THE METHOD "childNodes" IS ASSIGNED TO THE "list" VARIABLE TO GET IT'S CHILD NODES
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