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