Created
December 13, 2021 05:48
-
-
Save YasirGaji/07bfc3b194965c5d328b3481c721122d to your computer and use it in GitHub Desktop.
This gist showcases how to remove an element from the dom 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
const liElements = document.querySelectorAll('li'); // initializing a variable to represent all the "li" elements in the provided Html collection | |
liElements[1].remove(); // THIS TARGTES AND SELECTS THE "li" ELEMEMT IN THE SECOND INDEX IN THE "liElements" AND REMOVES IT |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment