XML DOM cloneNode() Method

The following code fragment loads "books.xml", clones the first <book> node and then adds it to the end of the node list

Definition and Usage

The cloneNode() method creates an exact copy of a specified node.

This method returns the cloned node.

Syntax

cloneNode(include_all)
Parameter Description
include_all Required. If the Boolean parameter is set to true, the cloned node clones all the child nodes of the original node as well

❮ Element Object