Name
Node
Synopsis
The granddaddy of much of the DOM, the Node class carries quite a lot of
information.
Node Constants
Node defines several constants that can be used by
application writers to determine the node’s nodeType.
ELEMENT_NODEAn
ElementnodeATTRIBUTE_NODEAn
AttrnodeTEXT_NODEA
TextnodeCDATA_SECTION_NODEA
CDATASectionnodeENTITY_REFERENCE_NODEAn
EntityReferencenodeENTITY_NODEAn
EntitynodePROCESSING_INSTRUCTION_NODEA
ProcessingInstructionnodeCOMMENT_NODEA
CommentnodeDOCUMENT_NODEA
DocumentnodeDOCUMENT_TYPE_NODEA
DocumentTypenodeDOCUMENT_FRAGMENT_NODEA
DocumentFragmentnodeNOTATION_NODEA
Notationnode
Node Properties and Methods
attributesThis contains a
NamedNodeMapthat contain the attributes of this node, or the value isNone.childNodesThis contains a
NodeListcontaining all children of this node. If no children exist then the list is empty.firstChildThe first child of the node. A convenient attribute if you know the structure of the document. If the node has no children, this is
None.lastChildSimilar to its counterpart
firstChild, but returns the last child node. If the node has no children, this isNone.localNameReturns the local part of the qualified name of the node.
namespaceURIThe namespace URI of the node or
Noneif none exists.nextSiblingThe node immediately following this node or
Noneif none exists.nodeNameThe name of the node, depending on its type. nodes of type
TextandCharacterDatado not have their own names, but rather just a string indicating that ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access