The applyElement method makes the element either a child or parent of another element. The applyElement method is accessible at run time. If elements are removed at run time before the closing tag is parsed, areas of the document might not render.


oNewElement of type Element

An object that becomes the child or parent of the current element.

sWhere of type String

Optional. If outside, the specified element becomes parent of the current element. The default parameter is outside. If inside, the specified element becomes a child of the current element, but contains all the child elements of the current element.

Return Value

Element The applied element, oNewElement.

JScript Error

E_INVALIDARG: Raised if oNewElement is null, oNewElement is outside the root node, or if oNewElement is not owned by the current document.