Section 25.211. Node.cloneNode( ): duplicate a node and, optionally, all of its descendants


25.211. Node.cloneNode( ): duplicate a node and, optionally, all of its descendants

DOM Level 1 Core

25.211.1. Synopsis

 Node cloneNode(boolean deep); 

25.211.1.1. Arguments

deep

If this argument is TRue, cloneNode( ) recursively clones all descendants of this node. Otherwise, it clones only this node.

25.211.1.2. Returns

A copy of this node.

25.211.2. Description

The cloneNode( ) method makes and returns a copy of the node on which it is called. If passed the argument true, it recursively clones all descendants of the node as well. Otherwise, it clones only the node and none of its children. The returned node is not part of the document tree, and its parentNode property is null. When an Element node is cloned, all of its attributes are also cloned. Note, however, that event-listener functions registered on a node are not cloned.




JavaScript. The Definitive Guide
JavaScript: The Definitive Guide
ISBN: 0596101996
EAN: 2147483647
Year: 2004
Pages: 767

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net