The nodeType JS Node returns a number appropriate for the type of node.
Type |
Description |
Number |
Element |
Node.ELEMENT_NODE |
1 |
Attr |
Node.ATTRIBUTE_NODE |
2 |
An exclusive Text node |
Node.TEXT_NODE |
3 |
CDATASection |
Node.CDATA_SECTION_NODE |
4 |
ProcessingInstruction |
Node.PROCESSING_INSTRUCTION_NODE |
7 |
Comment |
Node.COMMENT_NODE |
8 |
Document |
Node.DOCUMENT_NODE |
9 |
DocumentType |
Node.DOCUMENT_TYPE_NODE |
10 |
DocumentFragment |
Node.DOCUMENT_FRAGMENT_NODE |
11 |