Dom provides a set of attributes for navigation, accessing, and updating document content, including read-only and read-write attributes.
The following table showsRead-Only TypeProperties:
| DOM object attributes |
Return Value |
| Firstchild |
An object is returned, indicating the first child node ). |
| Lastchild |
An object is returned, indicating the last child node ). |
| Nextsibling |
An object is returned, indicating the next adjacent sibling node. |
| Nodename |
Returns the HTML Tag corresponding to the node. For example, P and script. Corresponding to the text item node, # text is returned. |
| Nodetype |
Type of the returned node, 1 indicates that this node is a tag ), 2 indicates attribute ), 3 indicates a text item. |
| Parentnode |
An object is returned, indicating the parent node of the current node ). |
| Previussibling |
An object is returned, indicating the previous adjacent sibling node. |
| Specified |
Returns a Boolean variable, indicating whether attribute is set ). |
The following table showsRead/write typeProperties:
| DOM object attributes |
Return Value |
| Data |
Returns a string that represents the value of a text item node. If it is a node of another type, undefined is returned. |
| Nodevalue |
Returns a string that represents the value of a text item node. If it is a node of another type, null is returned. |
The following table showsRelated attributesSet:
| DOM object attributes |
Return Value |
| Attributes |
Indicates the attribute set of the node, which is accessed by ID, such as attributes. Id. |
| Childnodes |
Indicates the child node set of a node, which is accessed through an array index, for example, childnodes [2]. |
[Tips]: these attributes and methods are only commonly used. If you want to obtain more methods or attributes, you can create an HTML Tag in vs.net IDE, then, use the shortcut key of vs.net IDE in <SCRIPT> </SCRIPT> to call up all Dom methods and attributes.