OBJ. appendchild (newe)Add the child node to the end of the parent node.
OBJ: parent element reference of the node to be added; newe: new node to be added.
Note: I found that when adding a subnode, the parent node cannot be referenced. If the parent node is referenced, the browser will crash due to overflow (as if using this word.
OBJ. clonenode (boolen)Get a copy of the current node
OBJ: reference of the current node; boolen: Boolean value, true: including the child nodes of the current node; false: not included. The returned value is a reference to the current node.
OBJ. haschildnodes ()Check whether a subnode exists at the current node. The returned value is a Boolean value. True indicates yes, and false indicates no.
OBJ: the node to be checked. In fact, the childnodes. Length attribute can also be used for detection, but the returned value of this attribute is the number of nodes.
OBJ. parentnode. insertbefore (newe. OBJ)Insert a new node before the current node.
OBJ: reference of the current node. ocument. getelementbyid ("tdiv"). childnodes (2) provides a byte point location variable, which can be placed anywhere.
Parentnode: Reference to the parent node of the current node, because this method inserts a new node before the current node, which is equal to inserting a byte point under the parent node, therefore, to reference the parent node, we do not need to know the information of its parent node, but only need to use the parentnode attribute.
Newe: The new node to be inserted.
OBJ. parentnode. removechild (OBJ)Delete a subnode
OBJ. parentnode: references to the parent node of the child node to be deleted. The principle is similar to that of "obj. parentnode. insertbefore (newe. OBJ.
OBJ: The subnode to be deleted.
OBJ. parentnode. replaceChild (newe, OBJ)Replace Old nodes with new nodes
OBJ. parentnode: refers to the parent node of the child node to be replaced. The principle is the same as above.
Newe: used to replace the New node of the old node.
OBJ: The old node to be replaced.