Document Method
Document. createElement (Tag): Create an html Tag object
Document. getElementById (ID): Get the object with the specified ID value
Document. getElementsByName (Name)// Obtain the object with the specified Name
GetElementsByTagName (tagName): Return all the Element nodes with the specified calibration name in the document, and return a node list (which can be viewed as an array)
GetElementByClassName (className): Return all Element nodes with the specified style name in the document, and return a node list (which can be viewed as an array)
CreateTextNode (text): Create a text node that contains static text
CreateAttribute (): Create a New Attr node with the specified name
CreateComment (): Create a new comment node with the specified string
Common attributes of a node
NodeType: Node Type
NodeName: Node name
NodeValue: Node Value
InnerHTML: Return all content in the node.
ParentNode: Returns the parent node of the current node. If no parent node exists, null is returned.
ChildNodes: Returns all the subnodes of the current node, which are stored in arrays. If no subnodes exist, an empty array is returned.
FirstChild: Returns the first subnode of the current node. If no subnode exists, null is returned.
LastChild: Returns the last subnode of the current node. If no subnode exists, null is returned.
NextSibling: Returns the next sibling node of the current node.
Previussibing: Returns the previous sibling node of the current node.
Attributes: If the node is an Element node, the attribute of the Element is returned in the form of nameNodeMap.
Node Method
RemoveChild(ChildNode): deletes the specified child element from the element.
Append(ChildNode): add the specified node (childNode) to the end of the subnode list of the current element (as a new subnode)
InsertBefore(NewNode, targetNode): insert the node newNode as the child node of the current element to the front of the child node element of targetNode.
ReplaceChild(NewNode, oldNode): replace node oldNode with node newNode.
CloneNode(True): copy the current node. "true" indicates copying the current node and all its child nodes.
HasChildNodes(): This method returns a Boolean value indicating whether the element has child elements.
GetAttribute(Name, value): obtains the value of the name attribute in the element.
SetAttribute(Name, value): set the value of the name attribute in the element.
RemoveAttribute(Name): deletes the attribute name from an element.
HasAttribute(Name): returns whether this element has the attribute of the specified name. If yes, returns true.
GetAttributeNode(): Returns the value of the specified attribute in the form of an Attr node.
SetAttributeNode(): Add the specified Attr node to the list of this element.
RemoveAttributeNode(): Deletes the specified Attr node from the attribute list of the element.
GetNamedItem(): Return the specified node. Often used in combination with attributes