This page is Almost Ready

Notice: The WebPlatform project, supported by various stewards between 2012 and 2015, has been discontinued. This site is now available on github.

importNode

Summary

Imports a node from another document into the the document that the document object displays.

Method of dom/Documentdom/Document

Syntax

var importedNode = document.importNode(node, deep);

Parameters

node

Data-type
DOM Node

The node to import.

deep

Data-type
Boolean

(Optional)

Whether child nodes of the node specified by the node parameter are also imported.

Return Value

Returns an object of type DOM NodeDOM Node

The node node that has been imported, or a null if the node cannot be imported.

Examples

The following code example illustrates the importNode method.

var oNode = document.importNode( oXHTMLNode, false);
parent.appendChild( oNode );

Related specifications

DOM Level 4
Candidate Recommendation
DOM Level 3 Core
Recommendation

Attributions