Home >Web Front-end >JS Tutorial >javascript copy node cloneNode() usage introduction_javascript skills
The cloneNode(a) method accepts a Boolean parameter, indicating whether to perform a deep copy.
true: Indicates performing a deep copy, copying this node and the entire child node tree.
false: Shallow copy. Only the node itself is copied.
The node copy returned after copying belongs to the document, but does not have a parent node. Unless you use appendChild, insertChild(), replaceChild() to add it to the document