public insertBefore(newChild as Node, refChild as Node) as Node throws DOMException
Inserts a node, or the ordered children of a document fragment, before a reference child. All hierarchy checks precede changes to either tree.
| Parameter | Description |
|---|---|
newChild | Node or fragment to insert. |
refChild | Existing child, or null to append. |
The supplied node; an inserted fragment is left empty.
root.insertBefore(child, root.firstChild)