Hi there! Are you looking for the official Deno documentation? Try docs.deno.com for all your Deno learning needs.

Node

Node is an interface from which a number of DOM API object types inherit. It allows those types to be treated similarly; for example, inheriting the same set of methods, or being tested in the same way.

interface Node extends EventTarget {
readonly ATTRIBUTE_NODE: number;
readonly baseURI: string;
readonly CDATA_SECTION_NODE: number;
readonly childNodes: NodeListOf<ChildNode>;
readonly COMMENT_NODE: number;
readonly DOCUMENT_FRAGMENT_NODE: number;
readonly DOCUMENT_NODE: number;
readonly DOCUMENT_POSITION_CONTAINED_BY: number;
readonly DOCUMENT_POSITION_CONTAINS: number;
readonly DOCUMENT_POSITION_DISCONNECTED: number;
readonly DOCUMENT_POSITION_FOLLOWING: number;
readonly DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: number;
readonly DOCUMENT_POSITION_PRECEDING: number;
readonly DOCUMENT_TYPE_NODE: number;
readonly ELEMENT_NODE: number;
readonly ENTITY_NODE: number;
readonly ENTITY_REFERENCE_NODE: number;
readonly firstChild: ChildNode | null;
readonly isConnected: boolean;
readonly lastChild: ChildNode | null;
readonly nextSibling: ChildNode | null;
readonly nodeName: string;
readonly nodeType: number;
nodeValue: string | null;
readonly NOTATION_NODE: number;
readonly ownerDocument: Document | null;
readonly parentElement: HTMLElement | null;
readonly parentNode: ParentNode | null;
readonly previousSibling: ChildNode | null;
readonly PROCESSING_INSTRUCTION_NODE: number;
readonly TEXT_NODE: number;
textContent: string | null;
appendChild<T extends Node>(node: T): T;
cloneNode(deep?: boolean): Node;
compareDocumentPosition(other: Node): number;
contains(other: Node | null): boolean;
getRootNode(options?: GetRootNodeOptions): Node;
hasChildNodes(): boolean;
insertBefore<T extends Node>(node: T, child: Node | null): T;
isDefaultNamespace(namespace: string | null): boolean;
isEqualNode(otherNode: Node | null): boolean;
isSameNode(otherNode: Node | null): boolean;
lookupNamespaceURI(prefix: string | null): string | null;
lookupPrefix(namespace: string | null): string | null;
normalize(): void;
removeChild<T extends Node>(child: T): T;
replaceChild<T extends Node>(node: Node, child: T): T;
}
var Node: {
prototype: Node;
readonly ATTRIBUTE_NODE: number;
readonly CDATA_SECTION_NODE: number;
readonly COMMENT_NODE: number;
readonly DOCUMENT_FRAGMENT_NODE: number;
readonly DOCUMENT_NODE: number;
readonly DOCUMENT_POSITION_CONTAINED_BY: number;
readonly DOCUMENT_POSITION_CONTAINS: number;
readonly DOCUMENT_POSITION_DISCONNECTED: number;
readonly DOCUMENT_POSITION_FOLLOWING: number;
readonly DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: number;
readonly DOCUMENT_POSITION_PRECEDING: number;
readonly DOCUMENT_TYPE_NODE: number;
readonly ELEMENT_NODE: number;
readonly ENTITY_NODE: number;
readonly ENTITY_REFERENCE_NODE: number;
readonly NOTATION_NODE: number;
readonly PROCESSING_INSTRUCTION_NODE: number;
readonly TEXT_NODE: number;
new (): Node;
}
;

§Extends

§Properties

§
readonly ATTRIBUTE_NODE: number
[src]
§
readonly baseURI: string
[src]

Returns node's node document's document base URL.

§
readonly CDATA_SECTION_NODE: number
[src]

node is a CDATASection node.

§
readonly childNodes: NodeListOf<ChildNode>
[src]

Returns the children.

§
readonly COMMENT_NODE: number
[src]

node is a Comment node.

§
readonly DOCUMENT_FRAGMENT_NODE: number
[src]

node is a DocumentFragment node.

§
readonly DOCUMENT_NODE: number
[src]

node is a document.

§
readonly DOCUMENT_POSITION_CONTAINED_BY: number
[src]

Set when other is a descendant of node.

§
readonly DOCUMENT_POSITION_CONTAINS: number
[src]

Set when other is an ancestor of node.

§
readonly DOCUMENT_POSITION_DISCONNECTED: number
[src]

Set when node and other are not in the same tree.

§
readonly DOCUMENT_POSITION_FOLLOWING: number
[src]

Set when other is following node.

§
readonly DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: number
[src]
§
readonly DOCUMENT_POSITION_PRECEDING: number
[src]

Set when other is preceding node.

§
readonly DOCUMENT_TYPE_NODE: number
[src]

node is a doctype.

§
readonly ELEMENT_NODE: number
[src]

node is an element.

§
readonly ENTITY_NODE: number
[src]
§
readonly ENTITY_REFERENCE_NODE: number
[src]
§
readonly firstChild: ChildNode | null
[src]

Returns the first child.

§
readonly isConnected: boolean
[src]

Returns true if node is connected and false otherwise.

§
readonly lastChild: ChildNode | null
[src]

Returns the last child.

§
readonly nextSibling: ChildNode | null
[src]

Returns the next sibling.

§
readonly nodeName: string
[src]

Returns a string appropriate for the type of node.

§
readonly nodeType: number
[src]

Returns the type of node.

§
nodeValue: string | null
[src]
§
readonly NOTATION_NODE: number
[src]
§
readonly ownerDocument: Document | null
[src]

Returns the node document. Returns null for documents.

§
readonly parentElement: HTMLElement | null
[src]

Returns the parent element.

§
readonly parentNode: ParentNode | null
[src]

Returns the parent.

§
readonly previousSibling: ChildNode | null
[src]

Returns the previous sibling.

§
readonly PROCESSING_INSTRUCTION_NODE: number
[src]

node is a ProcessingInstruction node.

§
readonly TEXT_NODE: number
[src]

node is a Text node.

§
textContent: string | null
[src]

§Methods

§
appendChild<T extends Node>(node: T): T
[src]
§
cloneNode(deep?: boolean): Node
[src]

Returns a copy of node. If deep is true, the copy also includes the node's descendants.

§
compareDocumentPosition(other: Node): number
[src]

Returns a bitmask indicating the position of other relative to node.

§
contains(other: Node | null): boolean
[src]

Returns true if other is an inclusive descendant of node, and false otherwise.

§
getRootNode(options?: GetRootNodeOptions): Node
[src]

Returns node's root.

§
hasChildNodes(): boolean
[src]

Returns whether node has children.

§
insertBefore<T extends Node>(node: T, child: Node | null): T
[src]
§
isDefaultNamespace(namespace: string | null): boolean
[src]
§
isEqualNode(otherNode: Node | null): boolean
[src]

Returns whether node and otherNode have the same properties.

§
isSameNode(otherNode: Node | null): boolean
[src]
§
lookupNamespaceURI(prefix: string | null): string | null
[src]
§
lookupPrefix(namespace: string | null): string | null
[src]
§
normalize(): void
[src]

Removes empty exclusive Text nodes and concatenates the data of remaining contiguous exclusive Text nodes into the first of their nodes.

§
removeChild<T extends Node>(child: T): T
[src]
§
replaceChild<T extends Node>(node: Node, child: T): T
[src]