Introduction to NodeName, NodeValue, and NodeType nodes

Source: Internet
Author: User

NodeName, NodeValue, and NodeType contain information about the node.   (a) 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 namethe nodeName of a text node is always #textthe nodeName of the document node is always #documentNote: The label name of the XML element contained in NodeName is always capitalized  (ii) NodeValue for text nodes, the NodeValue property contains text. for attribute nodes, the NodeValue property contains the property value. the NodeValue property is not available for document nodes and ELEMENT nodes.   (c) NodeTypeThe NodeType property returns the type of the node. The most important node types are:element type node type Elemental Element 1 Property attr 2 text 3 Note Comments 8 Document 9   (iv) So, look at an example of the jquery Handbook: Example Description: Find all text nodes and bold
HTML Code:

Hello <a href= "http://ejohn.org/" >JOHN</A>, how is you doing?


jQuery Code: $ ("P"). Contents (). Not (" [nodetype=1]"). Wrap ("<b/>"); Results:

Hello <a href= "http://ejohn.org/" >JOHN</A>, how is you doing?



example, NodeType is also a property value, not equal to 1 that is, select the child node within the P is not HTML tag things. So, write down the memo.

Introduction to NodeName, NodeValue, and NodeType nodes

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.