replaceNode method

[This documentation is preliminary and is subject to change.]

Replaces the object with another element.


IHTMLDOMNode retVal = object.replaceNode(replacement);

Standards information

There are no standards that apply here.


  • replacement [in]
    Type: IHTMLDOMNode

    An IDispatch that specifies the new element to replace the object.


When a node is replaced, all values that are associated with the replaced object are removed. For example, if a b object is replaced with an i object, any attributes and text between the opening and closing tags are also replaced. To preserve these values, copy them to the new element before the original object is replaced.

This 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.

See also




About the W3C Document Object Model



Build date: 6/12/2012