javascript Node ATTRIBUTE_NODE, CDATA_SECTION_NODE, COMMENT_NODE, DOCUMENT_FRAGMENT_NODE, DOCUMENT_NODE, DOCUMENT_TYPE_NODE, ELEMENT_NODE, ENTITY_NODE
|
ATTRIBUTE_NODE, CDATA_SECTION_NODE, COMMENT_NODE, |
NN 6 IE n/a DOM 1 | ||||||||||||||||||||||||||
|
|
Read-only | ||||||||||||||||||||||||||
|
This set of constants belongs to the root Node object of the W3C DOM, and is therefore inherited by all document-level nodes and elements. Each property corresponds to an integer value associated with the nodeType property of every DOM node. You can use these properties as a more plain-language way to indicate the node type your script is looking for in comparisons or similar operations. |
|||||||||||||||||||||||||||
| Example | |||||||||||||||||||||||||||
if (myObject.nodeType == document.ELEMENT_NODE) {
// process as an element here
}
|
|||||||||||||||||||||||||||
| Value | |||||||||||||||||||||||||||
|
Integer corresponding to DOM node type as follows. |
|||||||||||||||||||||||||||
|
|||||||||||||||||||||||||||
| Default | |||||||||||||||||||||||||||
|
Constant values (above). |
|||||||||||||||||||||||||||
Previous: javascript Node addEventListener( )
1318,Nickname,Homepage or email,Comments here,Add comment
