nodeType 节点简介

nodeType 节点简介

 1 interface Node {
 2   // NodeType
 3   const unsigned short      ELEMENT_NODE       = 1;
 4   const unsigned short      ATTRIBUTE_NODE     = 2;
 5   const unsigned short      TEXT_NODE          = 3;
 6   const unsigned short      CDATA_SECTION_NODE = 4;
 7   const unsigned short      ENTITY_REFERENCE_NODE = 5;
 8   const unsigned short      ENTITY_NODE        = 6;
 9   const unsigned short      PROCESSING_INSTRUCTION_NODE = 7;
10   const unsigned short      COMMENT_NODE       = 8;
11   const unsigned short      DOCUMENT_NODE      = 9;
12   const unsigned short      DOCUMENT_TYPE_NODE = 10;
13   const unsigned short      DOCUMENT_FRAGMENT_NODE = 11;
14   const unsigned short      NOTATION_NODE      = 12;
15 
16   readonly attribute  DOMString            nodeName;
17            attribute  DOMString            nodeValue;
18                                                  // raises(DOMException) on setting
19                                                  // raises(DOMException) on retrieval
20   readonly attribute  unsigned short       nodeType;
21   readonly attribute  Node                 parentNode;
22   readonly attribute  NodeList             childNodes;
23   readonly attribute  Node                 firstChild;
24   readonly attribute  Node                 lastChild;
25   readonly attribute  Node                 previousSibling;
26   readonly attribute  Node                 nextSibling;
27   readonly attribute  NamedNodeMap         attributes;
28   readonly attribute  Document             ownerDocument;
29   Node                      insertBefore(in Node newChild, 
30                                          in Node refChild)
31                                          raises(DOMException);
32   Node                      replaceChild(in Node newChild, 
33                                          in Node oldChild)
34                                          raises(DOMException);
35   Node                      removeChild(in Node oldChild)
36                                         raises(DOMException);
37   Node                      appendChild(in Node newChild)
38                                         raises(DOMException);
39   boolean                   hasChildNodes();
40   Node                      cloneNode(in boolean deep);
41 };
原文地址:https://www.cnblogs.com/snowinmay/p/3037463.html