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

Node

This object will be used as the prototype for Nodes when creating a DOM-Level-1-compliant structure.

class Node {
constructor(type: ElementType);
endIndex: number | null;
next: Node | null;
get nodeType(): number;
get nextSibling(): Node | null;
parent: NodeWithChildren | null;
get parentNode(): NodeWithChildren | null;
set parentNode(parent: NodeWithChildren | null);
prev: Node | null;
get previousSibling(): Node | null;
set previousSibling(prev: Node | null);
set nextSibling(next: Node | null);
sourceCodeLocation?: SourceCodeLocation | null;
startIndex: number | null;
type: ElementType;
 
cloneNode<T extends Node>(this: T, recursive?: boolean): T;
}

§Constructors

§
new Node(type: ElementType)
[src]
@param type

The type of the node.

§Properties

§
endIndex: number | null
[src]

The end index of the node. Requires withEndIndices on the handler to be `true.

§
nodeType: number readonly
[src]

DOM spec-compatible node {@link type}.

§
nextSibling: Node | null readonly
[src]

Same as {@link next}. DOM spec-compatible alias.

§
parent: NodeWithChildren | null
[src]

Parent of the node

§
parentNode: NodeWithChildren | null
[src]

Same as {@link parent}. DOM spec-compatible alias.

§
previousSibling: Node | null
[src]

Same as {@link prev}. DOM spec-compatible alias.

§
nextSibling: Node | null
[src]
§
sourceCodeLocation: SourceCodeLocation | null
[src]

parse5 source code location info.

Available if parsing with parse5 and location info is enabled.

§
startIndex: number | null
[src]

The start index of the node. Requires withStartIndices on the handler to be `true.

§
type: ElementType
[src]

§Methods

§
cloneNode<T extends Node>(this: T, recursive?: boolean): T
[src]

Clone this node, and optionally its children.

@param recursive

Clone child nodes as well.

@return

A clone of the node.