use of com.gargoylesoftware.htmlunit.javascript.host.dom.NodeList in project htmlunit by HtmlUnit.
the class HTMLElement method removeNode.
/**
* Removes this object from the document hierarchy.
* @param removeChildren whether to remove children or no
* @return a reference to the object that is removed
*/
@JsxFunction(IE)
public HTMLElement removeNode(final boolean removeChildren) {
final HTMLElement parent = (HTMLElement) getParentElement();
if (parent != null) {
parent.removeChild(this);
if (!removeChildren) {
final NodeList collection = getChildNodes();
final int length = collection.getLength();
for (int i = 0; i < length; i++) {
final Node object = (Node) collection.item(Integer.valueOf(0));
parent.appendChild(object);
}
}
}
return this;
}
Aggregations