Javascript Reference
Categories: Node

javascript Node ATTRIBUTE_NODE, CDATA_SECTION_NODE, COMMENT_NODE, DOCUMENT_FRAGMENT_NODE, DOCUMENT_NODE, DOCUMENT_TYPE_NODE, ELEMENT_NODE, ENTITY_NODE

@April 4, 2009, 2:46 a.m.

ATTRIBUTE_NODE, CDATA_SECTION_NODE, COMMENT_NODE,
DOCUMENT_FRAGMENT_NODE, DOCUMENT_NODE,
DOCUMENT_TYPE_NODE, ELEMENT_NODE,
ENTITY_NODE, ENTITY_REFERENCE_NODE,
NOTATION_NODE, PROCESSING_INSTRUCTION_NODE, TEXT_NODE

Firefox/Netscape/NN 6 IE n/a Chrome/Safari/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.

 
Property nodeType Value
ELEMENT_NODE 1
ATTRIBUTE_NODE 2
TEXT_NODE 3
CDATA_SECTION_NODE 4
ENTITY_REFERENCE_NODE 5
ENTITY_NODE 6
PROCESSING_INSTRUCTION_NODE 7
COMMENT_NODE 8
DOCUMENT_NODE 9
DOCUMENT_TYPE_NODE 10
DOCUMENT_FRAGMENT_NODE 11
NOTATION_NODE 12
 
Default

Constant values (above).

Hello,

New club music https://0daymusic.org
Download MP3/FLAC, Label, LIVESETS, Music Videos.
Richardgef - 11 months
Hello,

Club-Music download https://0daymusic.org MP3, FLAC, LIVESETS, Music Videos.

Team 0day
Waynedrend - 11 months
What do you advise to me?
battery - 1 years

Powered by Linode.