Skip to content

Instantly share code, notes, and snippets.

@YasirGaji
Created December 12, 2021 12:44
Show Gist options
  • Save YasirGaji/fdcbbc52da8b1c9d018da24b22053f53 to your computer and use it in GitHub Desktop.
Save YasirGaji/fdcbbc52da8b1c9d018da24b22053f53 to your computer and use it in GitHub Desktop.
This gist showcases specific children element selection 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[1]; // HERE THE SPECIFIC METHOD SELECTION "children[1]" SELECTS THE SECOND CHILD OF THE PARENT ELEMENT
val.textContent = 'Ensure To Follow'; // here we manipulate the selected child and change it's text content
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment