HTML Dom tutorial 6-html Dom node Information
1: node Information
Each node has attributes related to certain node information. These attributes are:
- Nodename (node name)
- Nodevalue)
- Nodetype (node type)
2: nodename
The nodename attribute contains the name of a node.
- The nodename of the element node is the label 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 by nodename is always capitalized.
3: nodevalue
For text nodes, the nodevalue attribute contains text.
For an attribute node, the nodevalue attribute contains the attribute value.
The nodevalue attribute is unavailable for document nodes and element nodes.
4: nodetype
The nodetype attribute returns the node type.
The most important node types are:
Element type |
Node Type |
Element |
1 |
Attribute |
2 |
Text |
3 |
Note |
8 |
Document |
9 |