/

HTML / CSS / JavaScript Tutorial

JavaScript DOM HTML method: cloneNode()

[this page | pdf | back links]

The cloneNode() method (when applied to HTML elements in the JavaScript DOM) Clones an element (i.e. creates a copy and returns that copy).

 

It has the following syntax with the following parameters. It returns a Node object representing the cloned node.

 

element.cloneNode(deepness)

 

Parameter

Required / Optional

Description

deepness

Required

Boolean value, which if false means only copy the node itself, but if true then also copy all child nodes, i.e. descendents, of the node

 


NAVIGATION LINKS
Contents | Prev | Next | JavaScript DOM (and BOM)


Desktop view | Switch to Mobile