Answers for "delete nodelist"

9

javascript remove dom element

var elem = document.querySelector('#some-element');
elem.parentNode.removeChild(elem);
Posted by: Guest on December-02-2019
0

Removing DOM nodes when traversing a NodeList

NodeList nodes = ...;
for (int i = nodes.getLength() - 1; i >= 0; i--) {
  Element e = (Element)nodes.item(i);
   if (certain criteria involving Element e) {
    e.getParentNode().removeChild(e);
  }
}
Posted by: Guest on June-17-2020

Code answers related to "Javascript"

Browse Popular Code Answers by Language