public replaceChild(newChild as Node, oldChild as Node) as Node throws DOMException
Replaces a child after validating the complete resulting tree. A fragment contributes its children, allowing an empty fragment to remove oldChild.
| Parameter | Description |
|---|---|
newChild | Replacement node or fragment. |
oldChild | Child to remove. |
The removed child.
document.replaceChild(document.createElement("new"), document.documentElement)