Skip to main content
Using Deno in production at your company? Earn free Deno merch.
Give us feedback
Module

x/gauntlet/imports/happy_dom.ts>Node

Work-in-progress front-end tool which does put a smile on my face
Latest
class Node
implements INode
extends EventTarget
Re-export
import { Node } from "https://deno.land/x/gauntlet@v0.0.9/imports/happy_dom.ts";

Node

Constructors

new
Node()

Constructor.

Properties

protected
_isConnected: boolean
protected
_observers: MutationObserverListener[]
readonly
childNodes: INodeList<INode>
readonly
firstChild: INode

First child.

isConnected: boolean

"true" if connected to DOM.

readonly
lastChild: INode

Last child.

readonly
nextSibling: INode

Next sibling.

readonly
nodeName: string

Node name.

readonly
nodeType: number
readonly
nodeValue: string

Node value.

readonly
ownerDocument: IDocument
readonly
parentElement: IElement

Returns parent element.

readonly
parentNode: INode
readonly
previousSibling: INode

Previous sibling.

textContent: string

Get text value of children.

Methods

_observe(listener: MutationObserverListener): void

Observeres the node. Used by MutationObserver, but it is not part of the HTML standard.

_unobserve(listener: MutationObserverListener): void

Stops observing the node. Used by MutationObserver, but it is not part of the HTML standard.

Append a child node to childNodes.

cloneNode(deep?: boolean): INode

Clones a node.

optional
connectedCallback(): void

Connected callback.

optional
disconnectedCallback(): void

Disconnected callback.

dispatchEvent(event: Event): boolean
getRootNode(options?: { composed: boolean; }): INode

Returns closest root node (Document or ShadowRoot).

insertBefore(newNode: INode, referenceNode?: INode | null): INode

Inserts a node before another.

Remove Child element from childNodes array.

replaceChild(newChild: INode, oldChild: INode): INode

Replaces a node with another.

toString(): string

Converts the node to a string.

Static Properties

readonly
COMMENT_NODE: number
readonly
DOCUMENT_FRAGMENT_NODE: number
readonly
DOCUMENT_NODE: number
readonly
DOCUMENT_TYPE_NODE: number
readonly
ELEMENT_NODE: number
ownerDocument: IDocument
readonly
TEXT_NODE: number