ProtectedchildThe raw list of every child node (all types), used to implement childNodes/firstChild/lastChild/insertBefore/removeChild. Not the same thing as Element.children (an HTMLCollection of just the element children).
ProtectedlistThe linker which holds this node in the children list of its parent, from which its siblings are found (null while it has no parent).
ProtectednodeProtectedownerThe document which made this node (createElement and the like), for when it is not in a tree yet.
Static ReadonlyATTRIBUTE_Static ReadonlyCDATA_Static ReadonlyCOMMENT_Static ReadonlyDEFAULT_Static ReadonlyDOCUMENT_Static ReadonlyDOCUMENT_Static ReadonlyDOCUMENT_Static ReadonlyDOCUMENT_Static ReadonlyDOCUMENT_Static ReadonlyDOCUMENT_Static ReadonlyDOCUMENT_Static ReadonlyDOCUMENT_Static ReadonlyDOCUMENT_Static ReadonlyELEMENT_Static ReadonlyENTITY_Static ReadonlyENTITY_Static ReadonlyNOTATION_Static ReadonlyPROCESSING_Static ReadonlyTEXT_ProtectedacceptsWhether this kind of node can have children (text, comments and attributes cannot).
Returns a string representing the base URL of the document containing the Node.
Returns a live NodeList containing all the children of this node (including elements, text and comments). NodeList being live means that if the children of the Node change, the NodeList object is automatically updated.
Returns a Node representing the first direct child node of the node, or null if the node has no child.
A boolean indicating whether or not the Node is connected (directly or indirectly) to the context object, e.g. the Document object in the case of the normal DOM, or the ShadowRoot in the case of a shadow DOM.
Returns a Node representing the last direct child node of the node, or null if the node has no child.
Returns a Node representing the next node in the tree, or null if there isn't such node.
Returns a string containing the name of the Node. The structure of the name will differ with the node type. E.g. An HTMLElement will contain the name of the corresponding tag, like 'audio' for an HTMLAudioElement, a Text node will have the '#text' string, or a Document node will have the '#document' string.
Returns an unsigned short representing the type of the node. Possible values are:
| Name | Value | |---------------------------------------- | ELEMENT_NODE | 1 | | ATTRIBUTE_NODE | 2 | | TEXT_NODE | 3 | | CDATA_SECTION_NODE | 4 | | PROCESSING_INSTRUCTION_NODE | 7 | | COMMENT_NODE | 8 | | DOCUMENT_NODE | 9 | | DOCUMENT_TYPE_NODE | 10 | | DOCUMENT_FRAGMENT_NODE | 11 |
Returns the value of the current node.
Returns the value of the current node.
Returns the Document that this node belongs to. If the node is itself a document, returns null.
Returns an Element that is the parent of this node. If the node has no parent, or if that parent is not an Element, this property returns null.
Returns a Node that is the parent of this node. If there is no such node, like if this node is the top of the tree or if doesn't participate in a tree, this property returns null.
Returns a Node representing the previous node in the tree, or null if there isn't such node.
Returns the textual content of an element and all its descendants.
Returns the textual content of an element and all its descendants.
Registers an event handler of a specific event type. Adding the same handler again for the same type and phase does nothing, like the DOM.
The type of event to listen for
The function to call (or an object with a handleEvent function)
Listen while the event travels down to the target (true), or an object with capture, once and passive
Add nodes (strings become text nodes) as this node's next siblings, in order. Does nothing when this node has no parent.
The nodes (or text) to add
Add nodes (strings become text nodes) as the last children of this node, in the order given.
The nodes (or text) to add
Add a node as the last child of this node (a node which is already in a tree is moved).
The node to add
The added node
Add nodes (strings become text nodes) as this node's previous siblings, in order. Does nothing when this node has no parent.
The nodes (or text) to add
ProtectedchildCalled each time a node has been inserted as a child of this node, so that nodes which need to react to children (for example elements applying default events) can do so.
The node which was inserted
Make a copy of this node (without its parent, and without its event listeners). With deep the children are copied too, all the way down.
Copy the children as well
ProtectedcloneMake a copy of this node without its children, its parent or its listeners, which is what cloneNode starts from. Kinds of node which are made with arguments override this to give them.
Say where another node is in relation to this one, as the bits of NodeService.DOCUMENT_POSITION_*: 0 for this node itself, DISCONNECTED (with IMPLEMENTATION_SPECIFIC and a consistent PRECEDING or FOLLOWING) for a node in another tree, CONTAINS + PRECEDING when the other node is an ancestor, CONTAINED_BY + FOLLOWING when it is a descendant, otherwise PRECEDING or FOLLOWING by their order in the tree.
The node to locate
Check whether a node is this node or one of its descendants.
The node to look for
Dispatches an event to this target and through the tree: capture listeners of the ancestors from the root down, then the listeners of this target, then (when the event bubbles) the other listeners of the ancestors from the parent up to the root. stopPropagation() stops it reaching further targets, stopImmediatePropagation() also stops the remaining listeners of the current target. Afterwards, unless the default was prevented, the default action of this target (see setDefaultEvent) runs. The event can be dispatched again afterwards.
The event to dispatch
False when the event was cancelable and a listener prevented the default, otherwise true
ProtectedequalsWhether another node of the same type is equal to this one apart from its children, which isEqualNode compares afterwards. Kinds of node with more to compare (an element has attributes) override this.
The node to compare with
Every element below this node which has all of the given (space separated) classes, live.
Every element below this node with the given tag name (or every element when tagName is *), live.
Every element below this node with the given tag name, live. There is no real namespace parsing here, so this ignores the namespace and behaves exactly like getElementsByTagName.
Ignored
Returns the context object's root which optionally includes the shadow root if it is available.
Returns a boolean value indicating whether the element has any child nodes.
Insert a node as a child of this node, before the given child (or at the end when there is none). A node which is already in a tree is moved, and the children of a document fragment are moved in order.
The node to insert
The child of this node to insert before, or null to insert at the end
The inserted node
Accepts a namespace URI as an argument and returns a boolean value with a value of true if the namespace is the default namespace on the given node or false if not.
Whether another node is the same as this one, by what they hold: the same type, name and value (an element also needs the same attributes), and children which are equal in the same order.
The node to compare with
Returns a boolean value indicating whether the two nodes are the same (that is, they reference the same object).
Accepts a prefix and returns the namespace URI associated with it on the given node if found (and null if not). Supplying null for the prefix will return the default namespace.
Returns a string containing the prefix for a given namespace URI, if present, and null if not. When multiple prefixes are possible, the result is implementation-dependent.
Tidy the text below this node: neighbouring text nodes are joined into one and empty text nodes are removed.
Add nodes (strings become text nodes) as the first children of this node, in the order given.
The nodes (or text) to add
The first element below this node which matches the CSS selector, in tree order, or null when there is none.
A CSS selector
Every element below this node which matches the CSS selector, in tree order. A plain array (not a live collection): like the DOM's querySelectorAll, it is a snapshot taken when it is called.
A CSS selector
Remove this node from its parent. Does nothing when it has no parent.
Remove a child from this node, it no longer has a parent or siblings afterwards.
The child node to remove
The removed node
Removes an event listener, the one which was added with the same type, handler and phase.
The type of event
The handler which was added
Whether the listener was a capture listener (true), or an object with capture
Replace a child of this node with another node (which is moved if it is already in a tree).
The node which takes the place
The child of this node to replace
The replaced node
Remove every child of this node and put the given nodes (strings become text nodes) in their place, in order.
The nodes (or text) to add
Put the given nodes (strings become text nodes) where this node is, in order, then remove this node. Does nothing when this node has no parent.
The nodes (or text) to put in this node's place
ProtectedsetRegister the function to run when nothing else has prevented the default for this type of event.
Simulate the behaviour of the Node Class when there is no DOM available.