Record several commonly used attributes in HTML DOM:
nodeName, nodeValue and nodeType contain information about nodes.
nodeName attribute contains the name of a node.
The nodeName of the element node is the tag name
The nodeName of the attribute node is the attribute name
The nodeName of the text node is always #text
The nodeName of the document node is always #document
Note: The tag name of the XML element contained in nodeName is always uppercase The
nodeValue
For text nodes, the nodeValue property contains the text.
For attribute nodes, the nodeValue attribute contains the attribute value.
nodeValue property is not available for document nodes and element nodes. The
nodeType
nodeType property returns the type of node.
The most important node types are:
Element type==》Node type
Element ==》1
Attribute attr ==》2
Text ==》3
Comments ==》8
Document document = =》9