adoptNode method
Tries to move a node from one document to the document that the document object displays.
![]() ![]() |
Syntax
var ppNodeDest = document.adoptNode(pNodeSource);Parameters
- pNodeSource [in]
-
Type: IHTMLDOMNode
A reference to the element object that refers to the node to move.
- ppNodeDest [out, retval]
-
Type: IHTMLDOMNode3
A reference to the element object that refers to the node that has been moved, or a null value if the node cannot be moved.
Return value
Type: IHTMLDOMNode3
A reference to the element object that refers to the node that has been moved, or a null value if the node cannot be moved.
Standards information
Examples
The following code example illustrates the adoptNode method and shows one way to handle cases where the method fails.
var oNode = document.adoptNode( oXHTMLNode ); if ( oNode == null ) oNode = document.importNode( oXHTMLNode ); parent.appendChild( oNode );
See also
Show:

