Skip to main content
The Deno 2 Release Candidate is here
Learn more
Module

x/gauntlet/imports/happy_dom.ts>IDocument

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

Document.

Properties

onreadystatechange: (event: Event) => void
readonly
defaultView: Window
readonly
implementation: DOMImplementation
readonly
documentElement: IHTMLElement
readonly
doctype: IDocumentType
readonly
body: IHTMLElement
readonly
head: IHTMLElement

Methods

write(html: string): void

Replaces the document HTML with new HTML.

open(): IDocument

Opens the document.

close(): void

Closes the document.

createElement(tagName: string, options?: { is: string; }): IElement

Creates an element.

createElementNS(
namespaceURI: string,
qualifiedName: string,
options?: { is: string; },
): IElement

Creates an element with the specified namespace URI and qualified name.

createTextNode(data: string): ICharacterData

Creates a text node.

createComment(data: string): ICharacterData

Creates a comment node.

createDocumentFragment(): IDocumentFragment

Creates a document fragment.

createTreeWalker(
root: INode,
whatToShow: number,
filter: INodeFilter,
): TreeWalker

Creates a Tree Walker.

createEvent(_type: string): Event

Creates an event.

createAttribute(name: string): Attr

Creates an Attr node.

createAttributeNS(namespaceURI: string, qualifiedName: string): Attr

Creates a namespaced Attr node.

importNode(node: INode): INode

Imports a node.

getElementById(id: string): IElement

Returns an element by ID.

cloneNode(deep: boolean): IDocument

Clones a node.

adoptNode(node: INode): INode

Adopts a node.