Inserts the specified node immediately before the specified reference node.

[VBScript]
Public Function InsertBefore( _
   ByVal newChild As Node, _
   ByVal refChild As Node _
) As Node
[JScript]
public function InsertBefore(
   newChild : Node,
   refChild : Node
) : Node;

Parameters

newChild
The node to insert. If it is a DocumentFragment, the entire contents of the document fragment are moved into the child list of this node.
refChild
The Node that is the reference node. The newChild is placed before this node.

Return Value

The node being inserted.

Remarks

If refChild is a null reference, insert newChild at the end of the list of child nodes. If the newChild is already in the tree, it is first removed.

See Also

Node Object | Node Members | DOM Namespace