org.w3c.dom.Node.replaceChild
method

    public replaceChild(newChild as Node, oldChild as Node) as Node throws DOMException

Description

Replaces one child node by another.

Parameters

Parameter | Description
--- | ---
`newChild` | Replacement node.
`oldChild` | Existing child.

Returns

Removed child.

Throws

- DOMException if replacement is invalid.

Example

    parent.replaceChild(newChild, oldChild)