Export (0) Print
Expand All
Information
The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

adoptNode method

Tries to move a node from one document to the document that the document object displays.

Document Object Model (DOM) Level 3 Core Specification, Section 1.4

Syntax

var ppNodeDest = document.adoptNode(pNodeSource);

Parameters

pNodeSource [in]

Type: IHTMLDOMNode

A reference to the element object that refers to the node to move.

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

document

 

 

Show:
© 2014 Microsoft