Interface Node
The Node interface is the primary datatype for the entire Document Object Model. It represents a single node in the document tree. While all objects implementing the Node interface expose methods for dealing with children, not all objects implementing the Node interface may have children. For example, Text nodes may not have children, and adding children to such nodes results in a DOMException being raised.
The attributes NodeName, NodeValue and Attributes are included as a mechanism to get at node information without casting down to the specific derived interface. In cases where there is no obvious mapping of these attributes for a specific nodeType (for example, nodeValue for an Element or attributes for a Comment), this returns null. Note that the specialized interfaces may contain additional and more convenient mechanisms to get and set the relevant information.
NodeType is a constant indicating which type of node it is, as defined in the node Interface according to the following table.
The values of NodeName and NodeValue vary according to the node type as defined in the following table.
| Interface | NodeName | NodeValue |
|---|
| Element | tagName | "" | | Attr | name of attribute | value of attribute | | Text | "text" | content of the text node | | CDATASection | "cdata-section" | content of the CDATA Section | | EntityReference | name of entity referenced | "" | | Entity | entity name | "" | | ProcessingInstruction | target | entire content excluding the target | | Comment | "comment" | content of the comment | | Document | "document" | "" | | DocumentType | document type name | "" | | DocumentFragment | "document-fragment" | "" | | Notation | notation name | "" |
If the node is of the node type Element, get_Attributes returns a NamedNodeMap. All other node types have no Attributes, thus returning null.
get_nodeName
get_nodeValue
set_nodeValue
get_nodeType
get_parentNode
get_childNodes
get_firstChild
get_lastChild
get_previousSibling
get_nextSibling
get_attributes
get_ownerDocument
insertBefore
replaceChild
removeChild
appendChild
hasChildNodes
cloneNode
normalize
isSupported
get_namespaceURI
get_prefix
set_prefix
get_localName
hasAttributes
e-Mail: denny@nodix.de
|