YouTip LogoYouTip

Met Document Adoptnode

# HTML DOM adoptNode() Method [![Image 3: Document Object Reference](#) Document Object](#) ## Example Get the first H1 element from an iframe and insert it into the current document: ```javascript var frame = document.getElementsByTagName("IFRAME"); var h = frame.contentWindow.document.getElementsByTagName("H1"); var x = document.adoptNode(h); [Try it Yourself Β»](#) * * * ## Definition and Usage The adoptNode() method is used to acquire a node from another document. The node can be of any node type. **Note:** All child nodes under the node will also be acquired. **Note:** The node and its child nodes will be removed from the source document. **Tip:** Use the [document.importNode()](#) method to copy a node, but the node in the original document is not removed. **Tip:** Use the [_element_.cloneNode()](#) method to copy a node in the current document, and the node will not be removed. * * * ## Browser Support The numbers in the table specify the first browser version that fully supports the method. | Method | | | | | | | --- | --- | --- | --- | --- | --- | | adoptNode() | Yes | 9.0 | 3.0 | Yes | 9.0 | * * * ## Syntax document.adoptNode(node) ## Parameter Values | Parameter | Type | Description | | --- | --- | --- | | _node_ | Node Object | Required. The node from another document, can be of any node type. | ## Technical Details | DOM Version: | Core Level 3 Document Object | | --- | | Return Value: | Node Object, representing the acquired node | * * Document Object](#)
← Js Htmldom CollectionsMet Win Stop β†’