agc
0
Q:

java script remowechild an element from the DOM

//The are 3 methods to access or find HTML Elements

let myId = document.getElementById(uniqueId);	
let paragraph = document.getElementsByTagName(p);
let myClass = document.getElementsByClassName(name);
0
let node = document.getElementById("nested");
if (node.parentNode) {
  node.parentNode.removeChild(node);
}
0
document.getElementById('[ID]') // returns live HTML Element Object
document.getElementsByClassName('[CLASS]') // returns live HTML Collection Object
document.getElementsByName('[NAME]') // returns live HTML Collection Object
document.getElementsByTagName('[ELEMENT-TYPE]') // returns live HTML Collection Object
-2

New to Communities?

Join the community