insertBefore method
Inserts an element into the document hierarchy as a child node of a parent object.
Syntax
IHTMLDOMNode retVal = object.insertBefore(newChild, refChild);
Parameters
newChild [in]
Type: IHTMLDOMNodePointer to an IHTMLDOMNode that specifies the new object to be inserted.
refChild [in, optional]
Type: VARIANTVARIANT of type VT_DISPATCH or VT_UNKNOWN that specifies the placement of the new element. If this parameter is specified, the new element will be inserted immediately before this existing child element.
Standards information
Remarks
Do not specify the refChild parameter when inserting the first child node. If children already exist and you do not specify the refChild parameter, the newChild becomes the last child of the parent object.
This method is accessible at run time. If elements are removed at run time, before the closing tag has been parsed, areas of the document might not render.
Windows Internet Explorer 9. Exceptions are only supported when webpages are displayed in IE9 Standards mode.
Microsoft Internet Explorer 6 and later. The attribute object supports this method.