nodeType property returns the node type -- as a number

以前查過但易混淆,

The nodeType property returns the node type, as a number, of the specified node.

If the node is an element node, the nodeType property will return 1.

If the node is an attribute node, the nodeType property will return 2.

If the node is a text node, the nodeType property will return 3.

If the node is a comment node, the nodeType property will return 8.

This property is read-only.

以上擷取自:

http://www.w3schools.com/jsref/prop_node_nodetype.asp



留言

熱門文章