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
ParameterDescription
newChildReplacement node.
oldChildExisting child.
Returns

Removed child.

Throws
  • DOMException if replacement is invalid.
Example
parent.replaceChild(newChild, oldChild)