Answers for "remove id from element javascript"

15

javascript remove element by id

//removing element by ID
var element = document.getElementById("myElementID");
    element.parentNode.removeChild(element);
Posted by: Guest on July-24-2019
6

remove attribute javascript

document.getElementsByTagName("H1")[0].removeAttribute("class");
Posted by: Guest on June-19-2020
282

Javascript Remove Element By Id Code Example

var colors = ["red","blue","car","green"];
var carIndex = colors.indexOf("car");//get  "car" index
//remove car from the colors array
colors.splice(carIndex, 1); // colors = ["red","blue","green"]
Posted by: Guest on July-19-2019

Code answers related to "remove id from element javascript"

Code answers related to "Javascript"

Browse Popular Code Answers by Language