insertBefore(newChild [, refChild] )
|
|
Parameters
|
NodenewChild
The node to insert.
NoderefChild
[optional] The reference node, i.e., the node before which the new node must be inserted.
|
Returns
|
Node. The node being inserted.
|
Throws
|
DOMException
HIERARCHY_REQUEST_ERR: Raised if this node is of a type that does not allow children of the type of the newChild node, or if the node to insert is one of this node's ancestors.
WRONG_DOCUMENT_ERR: Raised if newChild was created from a different document than the one that created this node.
NO_MODIFICATION_ALLOWED_ERR: Raised if this node is readonly or if the parent of the node being inserted is readonly.
NOT_FOUND_ERR: Raised if refChild is not a child of this node.
|