HTML Dom tutorial 6-html Dom node Information

Source: Internet
Author: User

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

 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.