Talking about the difference _javascript skill of nodename,nodevalue,nodetype,typeof

Source: Internet
Author: User
Tags processing instruction

The NodeName property contains the name of a node.

The nodename of the element node is the label name

The nodename of the attribute node is the property name

The nodename of the text node is always #text

The nodename of the document node is always #document

NodeValue node Value

For text nodes, the NodeValue property contains text.

For an attribute node, the NodeValue property contains the property value.

The NodeValue property is not available for document nodes and ELEMENT nodes.

The NodeType property can return the type of the node.

The most important node types are:

Element element1 attributes attr2 text text3 comments COMMENTS8 Documentation Document9 ADD:

Value-Element type

1-element

2-attribute

3-text

4-cdata

5-entity REFERENCE

6-entity

7-PI (processing instruction)

8-comment

9-document

10-document TYPE

11-document FRAGMENT

12-notation

typeof

Returns a String that represents the data type of an expression, with the possible strings: "Number", "string", "Boolean", "Object", "function", and "undefined"

The above is the entire content of this article, the small partners on these 4 knowledge points whether there is a new understanding of it, there are questions to my message it.

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.