📜  遍历 NodeList 时移除 DOM 节点 - Java 代码示例

📅  最后修改于: 2022-03-11 14:52:21.595000             🧑  作者: Mango

代码示例1
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);
  }
}