DOM object attributes

Source: Internet
Author: User
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].

 

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.