Skip to content

Instantly share code, notes, and snippets.

@YasirGaji
Created December 13, 2021 05:48
Show Gist options
  • Save YasirGaji/07bfc3b194965c5d328b3481c721122d to your computer and use it in GitHub Desktop.
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
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