Created
December 12, 2021 14:10
-
-
Save YasirGaji/4172054e7836478143c8e5bd003dec2c to your computer and use it in GitHub Desktop.
This gist showcases specific children element's children selection manipulation 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[1].children[0]; // HERE WE ARE SELECTING THE FIRST CHILD OF THE SECOND CHILD IN THE "list" AND ASSIGNING IT TO "val" | |
val.style.color = 'red'; // here we manipulate and change "val"'s color |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment