Created
February 17, 2022 08:32
-
-
Save nikeedev/2a5c1ebfb45990272f9670b6bc91be15 to your computer and use it in GitHub Desktop.
Delete HTML/DOM elements using their name or id/class tag.
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
var answer = prompt("What element to delete?"); | |
var lovedones = document.querySelector(answer); | |
lovedones.remove(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment