Under what circumstances is a clone node used?
We know that if you use the node directly during the DOM operation, the node will change with the operation. For example, the node is added to the new place, and the nodes in the original position are
JS DOM node:The relationship of a node in the JS DOM is defined as the attribute of the node:There are usually the following types of relationships between nodes:(The relationship here is supported by all browsers)
ParentNode parent Node
Using DOM to copy (clone) the data of a specified node name to a New XML file, three knowledge points are used: DOMDocument-DOMNodeList-DOMNode
The Code is as follows:
/*
Content1
2009-10-11
Copy codeThe Code is as follows:/* content1 2009-10-11 title2 content2 2009-11-11 *//*Using DOM to copy (clone) the data of a specified node name to a New XML file, three knowledge points are used: DOMDocument-DOMNodeList-DOMNode1. DOMNodeList
Full parse of select node clone2009-12-18In the Development Ns-log project, Statistical classification has the function of copying. Since the data in the previous statistical classification is assigned by JS, the user may have modified it and found
Deep understanding of DOM copy clone () and deep dom copy clone
A clone node is a common DOM operation. jQuery provides a clone method to process dom cloning:
The. clone () method deeply copies all matching element sets, including all matching
Deep clones (the text node within the clone element plus all the descendants element nodes),Shallow Clone (clone the element itself, do not clone the text node and the Descendants node),1. CloneNode () accepts a parameter with an optional value of
Clone mode is both prototype mode and one of the construction patterns. The intention is to use a prototype instance to specify the type of object to create, and to create a new object by copying the prototypes.
The key code is as follows:
virtual
Recently, it was found that the DOMDocument object is very important, and XMLHTTP is also important to note that case sensitivity must not be mistaken.
Attribute:
Attribute list of the Attributes storage node (read-only)
List of child nodes of the
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.