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

Document

Any web page loaded in the browser and serves as an entry point into the web page's content, which is the DOM tree.

interface Document extends Node, DocumentAndElementEventHandlers, DocumentOrShadowRoot, FontFaceSource, GlobalEventHandlers, NonElementParentNode, ParentNode, XPathEvaluatorBase {
alinkColor: string;
readonly all: HTMLAllCollection;
readonly applets: HTMLCollection;
bgColor: string;
readonly characterSet: string;
readonly charset: string;
readonly compatMode: string;
readonly contentType: string;
cookie: string;
readonly currentScript: HTMLOrSVGScriptElement | null;
readonly defaultView: (WindowProxy & globalThis) | null;
designMode: string;
dir: string;
readonly doctype: DocumentType | null;
readonly documentElement: HTMLElement;
readonly documentURI: string;
domain: string;
fgColor: string;
readonly fullscreen: boolean;
readonly fullscreenEnabled: boolean;
readonly head: HTMLHeadElement;
readonly hidden: boolean;
readonly implementation: DOMImplementation;
readonly inputEncoding: string;
readonly lastModified: string;
linkColor: string;
onfullscreenchange: ((this: Document, ev: Event) => any) | null;
onfullscreenerror: ((this: Document, ev: Event) => any) | null;
onpointerlockchange: ((this: Document, ev: Event) => any) | null;
onpointerlockerror: ((this: Document, ev: Event) => any) | null;
onreadystatechange: ((this: Document, ev: Event) => any) | null;
onvisibilitychange: ((this: Document, ev: Event) => any) | null;
readonly ownerDocument: null;
readonly pictureInPictureEnabled: boolean;
readonly readyState: DocumentReadyState;
readonly referrer: string;
readonly rootElement: SVGSVGElement | null;
readonly scrollingElement: Element | null;
readonly timeline: DocumentTimeline;
title: string;
readonly URL: string;
readonly visibilityState: DocumentVisibilityState;
vlinkColor: string;
addEventListener<K extends keyof DocumentEventMap>(
type: K,
listener: (this: Document, ev: DocumentEventMap[K]) => any,
options?: boolean | AddEventListenerOptions,
): void;
addEventListener(
type: string,
options?: boolean | AddEventListenerOptions,
): void;
adoptNode<T extends Node>(node: T): T;
captureEvents(): void;
caretRangeFromPoint(x: number, y: number): Range | null;
clear(): void;
close(): void;
createAttribute(localName: string): Attr;
createAttributeNS(namespace: string | null, qualifiedName: string): Attr;
createCDATASection(data: string): CDATASection;
createComment(data: string): Comment;
createDocumentFragment(): DocumentFragment;
createElement<K extends keyof HTMLElementTagNameMap>(tagName: K, options?: ElementCreationOptions): HTMLElementTagNameMap[K];
createElement<K extends keyof HTMLElementDeprecatedTagNameMap>(tagName: K, options?: ElementCreationOptions): HTMLElementDeprecatedTagNameMap[K];
createElement(tagName: string, options?: ElementCreationOptions): HTMLElement;
createElementNS(namespaceURI: "http://www.w3.org/1999/xhtml", qualifiedName: string): HTMLElement;
createElementNS<K extends keyof SVGElementTagNameMap>(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: K): SVGElementTagNameMap[K];
createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: string): SVGElement;
createElementNS(
namespaceURI: string | null,
qualifiedName: string,
): Element;
createElementNS(
namespace: string | null,
qualifiedName: string,
options?: string | ElementCreationOptions,
): Element;
createEvent(eventInterface: "AnimationEvent"): AnimationEvent;
createEvent(eventInterface: "AnimationPlaybackEvent"): AnimationPlaybackEvent;
createEvent(eventInterface: "AudioProcessingEvent"): AudioProcessingEvent;
createEvent(eventInterface: "BeforeUnloadEvent"): BeforeUnloadEvent;
createEvent(eventInterface: "BlobEvent"): BlobEvent;
createEvent(eventInterface: "ClipboardEvent"): ClipboardEvent;
createEvent(eventInterface: "CloseEvent"): CloseEvent;
createEvent(eventInterface: "CompositionEvent"): CompositionEvent;
createEvent(eventInterface: "CustomEvent"): CustomEvent;
createEvent(eventInterface: "DeviceMotionEvent"): DeviceMotionEvent;
createEvent(eventInterface: "DeviceOrientationEvent"): DeviceOrientationEvent;
createEvent(eventInterface: "DragEvent"): DragEvent;
createEvent(eventInterface: "ErrorEvent"): ErrorEvent;
createEvent(eventInterface: "Event"): Event;
createEvent(eventInterface: "Events"): Event;
createEvent(eventInterface: "FocusEvent"): FocusEvent;
createEvent(eventInterface: "FontFaceSetLoadEvent"): FontFaceSetLoadEvent;
createEvent(eventInterface: "FormDataEvent"): FormDataEvent;
createEvent(eventInterface: "GamepadEvent"): GamepadEvent;
createEvent(eventInterface: "HashChangeEvent"): HashChangeEvent;
createEvent(eventInterface: "IDBVersionChangeEvent"): IDBVersionChangeEvent;
createEvent(eventInterface: "InputEvent"): InputEvent;
createEvent(eventInterface: "KeyboardEvent"): KeyboardEvent;
createEvent(eventInterface: "MediaEncryptedEvent"): MediaEncryptedEvent;
createEvent(eventInterface: "MediaKeyMessageEvent"): MediaKeyMessageEvent;
createEvent(eventInterface: "MediaQueryListEvent"): MediaQueryListEvent;
createEvent(eventInterface: "MediaRecorderErrorEvent"): MediaRecorderErrorEvent;
createEvent(eventInterface: "MediaStreamTrackEvent"): MediaStreamTrackEvent;
createEvent(eventInterface: "MessageEvent"): MessageEvent;
createEvent(eventInterface: "MouseEvent"): MouseEvent;
createEvent(eventInterface: "MouseEvents"): MouseEvent;
createEvent(eventInterface: "MutationEvent"): MutationEvent;
createEvent(eventInterface: "MutationEvents"): MutationEvent;
createEvent(eventInterface: "OfflineAudioCompletionEvent"): OfflineAudioCompletionEvent;
createEvent(eventInterface: "PageTransitionEvent"): PageTransitionEvent;
createEvent(eventInterface: "PaymentMethodChangeEvent"): PaymentMethodChangeEvent;
createEvent(eventInterface: "PaymentRequestUpdateEvent"): PaymentRequestUpdateEvent;
createEvent(eventInterface: "PointerEvent"): PointerEvent;
createEvent(eventInterface: "PopStateEvent"): PopStateEvent;
createEvent(eventInterface: "ProgressEvent"): ProgressEvent;
createEvent(eventInterface: "PromiseRejectionEvent"): PromiseRejectionEvent;
createEvent(eventInterface: "RTCDTMFToneChangeEvent"): RTCDTMFToneChangeEvent;
createEvent(eventInterface: "RTCDataChannelEvent"): RTCDataChannelEvent;
createEvent(eventInterface: "RTCErrorEvent"): RTCErrorEvent;
createEvent(eventInterface: "RTCPeerConnectionIceErrorEvent"): RTCPeerConnectionIceErrorEvent;
createEvent(eventInterface: "RTCPeerConnectionIceEvent"): RTCPeerConnectionIceEvent;
createEvent(eventInterface: "RTCTrackEvent"): RTCTrackEvent;
createEvent(eventInterface: "SecurityPolicyViolationEvent"): SecurityPolicyViolationEvent;
createEvent(eventInterface: "SpeechSynthesisErrorEvent"): SpeechSynthesisErrorEvent;
createEvent(eventInterface: "SpeechSynthesisEvent"): SpeechSynthesisEvent;
createEvent(eventInterface: "StorageEvent"): StorageEvent;
createEvent(eventInterface: "SubmitEvent"): SubmitEvent;
createEvent(eventInterface: "TouchEvent"): TouchEvent;
createEvent(eventInterface: "TrackEvent"): TrackEvent;
createEvent(eventInterface: "TransitionEvent"): TransitionEvent;
createEvent(eventInterface: "UIEvent"): UIEvent;
createEvent(eventInterface: "UIEvents"): UIEvent;
createEvent(eventInterface: "WebGLContextEvent"): WebGLContextEvent;
createEvent(eventInterface: "WheelEvent"): WheelEvent;
createEvent(eventInterface: string): Event;
createNodeIterator(
root: Node,
whatToShow?: number,
filter?: NodeFilter | null,
): NodeIterator;
createProcessingInstruction(target: string, data: string): ProcessingInstruction;
createRange(): Range;
createTextNode(data: string): Text;
createTreeWalker(
root: Node,
whatToShow?: number,
filter?: NodeFilter | null,
): TreeWalker;
execCommand(
commandId: string,
showUI?: boolean,
value?: string,
): boolean;
exitFullscreen(): Promise<void>;
exitPictureInPicture(): Promise<void>;
exitPointerLock(): void;
getElementById(elementId: string): HTMLElement | null;
getElementsByClassName(classNames: string): HTMLCollectionOf<Element>;
getElementsByName(elementName: string): NodeListOf<HTMLElement>;
getElementsByTagName<K extends keyof HTMLElementTagNameMap>(qualifiedName: K): HTMLCollectionOf<HTMLElementTagNameMap[K]>;
getElementsByTagName<K extends keyof SVGElementTagNameMap>(qualifiedName: K): HTMLCollectionOf<SVGElementTagNameMap[K]>;
getElementsByTagName(qualifiedName: string): HTMLCollectionOf<Element>;
getElementsByTagNameNS(namespaceURI: "http://www.w3.org/1999/xhtml", localName: string): HTMLCollectionOf<HTMLElement>;
getElementsByTagNameNS(namespaceURI: "http://www.w3.org/2000/svg", localName: string): HTMLCollectionOf<SVGElement>;
getElementsByTagNameNS(namespace: string | null, localName: string): HTMLCollectionOf<Element>;
getSelection(): Selection | null;
hasFocus(): boolean;
hasStorageAccess(): Promise<boolean>;
importNode<T extends Node>(node: T, deep?: boolean): T;
get location(): Location;
set location(href: string | Location);
open(unused1?: string, unused2?: string): Document;
open(
url: string | URL,
name: string,
features: string,
): WindowProxy | null;
queryCommandEnabled(commandId: string): boolean;
queryCommandIndeterm(commandId: string): boolean;
queryCommandState(commandId: string): boolean;
queryCommandSupported(commandId: string): boolean;
queryCommandValue(commandId: string): string;
releaseEvents(): void;
removeEventListener<K extends keyof DocumentEventMap>(
type: K,
listener: (this: Document, ev: DocumentEventMap[K]) => any,
options?: boolean | EventListenerOptions,
): void;
removeEventListener(
type: string,
options?: boolean | EventListenerOptions,
): void;
requestStorageAccess(): Promise<void>;
write(...text: string[]): void;
writeln(...text: string[]): void;
}
var Document: {
prototype: Document;
new (): Document;
}
;

§Extends

§Properties

§
alinkColor: string
[src]

Sets or gets the color of all active links in the document.

§

Returns a reference to the collection of elements contained by the object.

§

Retrieves a collection of all a objects that have a name and/or id property. Objects in this collection are in HTML source order.

§
readonly applets: HTMLCollection
[src]

Retrieves a collection of all applet objects in the document.

§
bgColor: string
[src]

Deprecated. Sets or retrieves a value that indicates the background color behind the object.

§

Specifies the beginning and end of the document body.

§
readonly characterSet: string
[src]

Returns document's encoding.

§
readonly charset: string
[src]

Gets or sets the character set used to encode the object.

§
readonly compatMode: string
[src]

Gets a value that indicates whether standards-compliant mode is switched on for the object.

§
readonly contentType: string
[src]

Returns document's content type.

§
readonly currentScript: HTMLOrSVGScriptElement | null
[src]

Returns the script element, or the SVG script element, that is currently executing, as long as the element represents a classic script. In the case of reentrant script execution, returns the one that most recently started executing amongst those that have not yet finished executing.

Returns null if the Document is not currently executing a script or SVG script element (e.g., because the running script is an event handler, or a timeout), or if the currently executing script or SVG script element represents a module script.

§
readonly defaultView: (WindowProxy & globalThis) | null
[src]

Returns the Window object of the active document.

§
designMode: string
[src]

Sets or gets a value that indicates whether the document can be edited.

§
dir: string
[src]

Sets or retrieves a value that indicates the reading order of the object.

§
readonly doctype: DocumentType | null
[src]

Gets an object representing the document type declaration associated with the current document.

§
readonly documentElement: HTMLElement
[src]

Gets a reference to the root node of the document.

§
readonly documentURI: string
[src]

Returns document's URL.

§
domain: string
[src]

Sets or gets the security domain of the document.

§

Retrieves a collection of all embed objects in the document.

§
fgColor: string
[src]

Sets or gets the foreground (text) color of the document.

§

Retrieves a collection, in source order, of all form objects in the document.

§
readonly fullscreen: boolean
[src]
§
readonly fullscreenEnabled: boolean
[src]

Returns true if document has the ability to display elements fullscreen and fullscreen is supported, or false otherwise.

§
readonly hidden: boolean
[src]
§

Retrieves a collection, in source order, of img objects in the document.

§
readonly implementation: DOMImplementation
[src]

Gets the implementation object of the current document.

§
readonly inputEncoding: string
[src]

Returns the character encoding used to create the webpage that is loaded into the document object.

§
readonly lastModified: string
[src]

Gets the date that the page was last modified, if the page supplies one.

§
linkColor: string
[src]

Sets or gets the color of the document links.

§
onfullscreenchange: ((this: Document, ev: Event) => any) | null
[src]
§
onfullscreenerror: ((this: Document, ev: Event) => any) | null
[src]
§
onpointerlockchange: ((this: Document, ev: Event) => any) | null
[src]
§
onpointerlockerror: ((this: Document, ev: Event) => any) | null
[src]
§
onreadystatechange: ((this: Document, ev: Event) => any) | null
[src]

Fires when the state of the object has changed.

§
onvisibilitychange: ((this: Document, ev: Event) => any) | null
[src]
§
readonly ownerDocument: null
[src]
§
readonly pictureInPictureEnabled: boolean
[src]
§

Return an HTMLCollection of the embed elements in the Document.

§
readonly readyState: DocumentReadyState
[src]

Retrieves a value that indicates the current state of the object.

§
readonly referrer: string
[src]

Gets the URL of the location that referred the user to the current page.

§
readonly rootElement: SVGSVGElement | null
[src]
§

Retrieves a collection of all script objects in the document.

§
readonly scrollingElement: Element | null
[src]
§
readonly timeline: DocumentTimeline
[src]
§
title: string
[src]

Contains the title of the document.

§
readonly URL: string
[src]

Sets or gets the URL for the current document.

§
readonly visibilityState: DocumentVisibilityState
[src]
§
vlinkColor: string
[src]

Sets or gets the color of the links that the user has visited.

§Methods

§
addEventListener<K extends keyof DocumentEventMap>(
type: K,
listener: (this: Document, ev: DocumentEventMap[K]) => any,
options?: boolean | AddEventListenerOptions,
): void
[src]
§
addEventListener(
type: string,
options?: boolean | AddEventListenerOptions,
): void
[src]
§
adoptNode<T extends Node>(node: T): T
[src]

Moves node from another document and returns it.

If node is a document, throws a "NotSupportedError" DOMException or, if node is a shadow root, throws a "HierarchyRequestError" DOMException.

§
captureEvents(): void
[src]
§
caretRangeFromPoint(x: number, y: number): Range | null
[src]
§
clear(): void
[src]
§
close(): void
[src]

Closes an output stream and forces the sent data to display.

§
createAttribute(localName: string): Attr
[src]

Creates an attribute object with a specified name.

@param name

String that sets the attribute object's name.

§
createAttributeNS(namespace: string | null, qualifiedName: string): Attr
[src]
§
createCDATASection(data: string): CDATASection
[src]

Returns a CDATASection node whose data is data.

§
createComment(data: string): Comment
[src]

Creates a comment object with the specified data.

@param data

Sets the comment object's data.

§
createDocumentFragment(): DocumentFragment
[src]

Creates a new document.

§
createElement<K extends keyof HTMLElementTagNameMap>(tagName: K, options?: ElementCreationOptions): HTMLElementTagNameMap[K]
[src]

Creates an instance of the element for the specified tag.

@param tagName

The name of an element.

§
createElement(tagName: string, options?: ElementCreationOptions): HTMLElement
[src]
§
createElementNS(namespaceURI: "http://www.w3.org/1999/xhtml", qualifiedName: string): HTMLElement
[src]

Returns an element with namespace namespace. Its namespace prefix will be everything before ":" (U+003E) in qualifiedName or null. Its local name will be everything after ":" (U+003E) in qualifiedName or qualifiedName.

If localName does not match the Name production an "InvalidCharacterError" DOMException will be thrown.

If one of the following conditions is true a "NamespaceError" DOMException will be thrown:

localName does not match the QName production. Namespace prefix is not null and namespace is the empty string. Namespace prefix is "xml" and namespace is not the XML namespace. qualifiedName or namespace prefix is "xmlns" and namespace is not the XMLNS namespace. namespace is the XMLNS namespace and neither qualifiedName nor namespace prefix is "xmlns".

When supplied, options's is can be used to create a customized built-in element.

§
createElementNS<K extends keyof SVGElementTagNameMap>(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: K): SVGElementTagNameMap[K]
[src]
§
createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: string): SVGElement
[src]
§
createElementNS(
namespaceURI: string | null,
qualifiedName: string,
): Element
[src]
§
createElementNS(
namespace: string | null,
qualifiedName: string,
options?: string | ElementCreationOptions,
): Element
[src]
§
createEvent(eventInterface: "AnimationEvent"): AnimationEvent
[src]
§
createEvent(eventInterface: "AnimationPlaybackEvent"): AnimationPlaybackEvent
[src]
§
createEvent(eventInterface: "AudioProcessingEvent"): AudioProcessingEvent
[src]
§
createEvent(eventInterface: "BeforeUnloadEvent"): BeforeUnloadEvent
[src]
§
createEvent(eventInterface: "BlobEvent"): BlobEvent
[src]
§
createEvent(eventInterface: "ClipboardEvent"): ClipboardEvent
[src]
§
createEvent(eventInterface: "CloseEvent"): CloseEvent
[src]
§
createEvent(eventInterface: "CompositionEvent"): CompositionEvent
[src]
§
createEvent(eventInterface: "CustomEvent"): CustomEvent
[src]
§
createEvent(eventInterface: "DeviceMotionEvent"): DeviceMotionEvent
[src]
§
createEvent(eventInterface: "DeviceOrientationEvent"): DeviceOrientationEvent
[src]
§
createEvent(eventInterface: "DragEvent"): DragEvent
[src]
§
createEvent(eventInterface: "ErrorEvent"): ErrorEvent
[src]
§
createEvent(eventInterface: "Event"): Event
[src]
§
createEvent(eventInterface: "Events"): Event
[src]
§
createEvent(eventInterface: "FocusEvent"): FocusEvent
[src]
§
createEvent(eventInterface: "FontFaceSetLoadEvent"): FontFaceSetLoadEvent
[src]
§
createEvent(eventInterface: "FormDataEvent"): FormDataEvent
[src]
§
createEvent(eventInterface: "GamepadEvent"): GamepadEvent
[src]
§
createEvent(eventInterface: "HashChangeEvent"): HashChangeEvent
[src]
§
createEvent(eventInterface: "IDBVersionChangeEvent"): IDBVersionChangeEvent
[src]
§
createEvent(eventInterface: "InputEvent"): InputEvent
[src]
§
createEvent(eventInterface: "KeyboardEvent"): KeyboardEvent
[src]
§
createEvent(eventInterface: "MediaEncryptedEvent"): MediaEncryptedEvent
[src]
§
createEvent(eventInterface: "MediaKeyMessageEvent"): MediaKeyMessageEvent
[src]
§
createEvent(eventInterface: "MediaQueryListEvent"): MediaQueryListEvent
[src]
§
createEvent(eventInterface: "MediaRecorderErrorEvent"): MediaRecorderErrorEvent
[src]
§
createEvent(eventInterface: "MediaStreamTrackEvent"): MediaStreamTrackEvent
[src]
§
createEvent(eventInterface: "MessageEvent"): MessageEvent
[src]
§
createEvent(eventInterface: "MouseEvent"): MouseEvent
[src]
§
createEvent(eventInterface: "MouseEvents"): MouseEvent
[src]
§
createEvent(eventInterface: "MutationEvent"): MutationEvent
[src]
§
createEvent(eventInterface: "MutationEvents"): MutationEvent
[src]
§
createEvent(eventInterface: "OfflineAudioCompletionEvent"): OfflineAudioCompletionEvent
[src]
§
createEvent(eventInterface: "PageTransitionEvent"): PageTransitionEvent
[src]
§
createEvent(eventInterface: "PaymentMethodChangeEvent"): PaymentMethodChangeEvent
[src]
§
createEvent(eventInterface: "PaymentRequestUpdateEvent"): PaymentRequestUpdateEvent
[src]
§
createEvent(eventInterface: "PointerEvent"): PointerEvent
[src]
§
createEvent(eventInterface: "PopStateEvent"): PopStateEvent
[src]
§
createEvent(eventInterface: "ProgressEvent"): ProgressEvent
[src]
§
createEvent(eventInterface: "PromiseRejectionEvent"): PromiseRejectionEvent
[src]
§
createEvent(eventInterface: "RTCDTMFToneChangeEvent"): RTCDTMFToneChangeEvent
[src]
§
createEvent(eventInterface: "RTCDataChannelEvent"): RTCDataChannelEvent
[src]
§
createEvent(eventInterface: "RTCErrorEvent"): RTCErrorEvent
[src]
§
createEvent(eventInterface: "RTCPeerConnectionIceErrorEvent"): RTCPeerConnectionIceErrorEvent
[src]
§
createEvent(eventInterface: "RTCPeerConnectionIceEvent"): RTCPeerConnectionIceEvent
[src]
§
createEvent(eventInterface: "RTCTrackEvent"): RTCTrackEvent
[src]
§
createEvent(eventInterface: "SecurityPolicyViolationEvent"): SecurityPolicyViolationEvent
[src]
§
createEvent(eventInterface: "SpeechSynthesisErrorEvent"): SpeechSynthesisErrorEvent
[src]
§
createEvent(eventInterface: "SpeechSynthesisEvent"): SpeechSynthesisEvent
[src]
§
createEvent(eventInterface: "StorageEvent"): StorageEvent
[src]
§
createEvent(eventInterface: "SubmitEvent"): SubmitEvent
[src]
§
createEvent(eventInterface: "TouchEvent"): TouchEvent
[src]
§
createEvent(eventInterface: "TrackEvent"): TrackEvent
[src]
§
createEvent(eventInterface: "TransitionEvent"): TransitionEvent
[src]
§
createEvent(eventInterface: "UIEvent"): UIEvent
[src]
§
createEvent(eventInterface: "UIEvents"): UIEvent
[src]
§
createEvent(eventInterface: "WebGLContextEvent"): WebGLContextEvent
[src]
§
createEvent(eventInterface: "WheelEvent"): WheelEvent
[src]
§
createEvent(eventInterface: string): Event
[src]
§
createNodeIterator(
root: Node,
whatToShow?: number,
filter?: NodeFilter | null,
): NodeIterator
[src]

Creates a NodeIterator object that you can use to traverse filtered lists of nodes or elements in a document.

@param root

The root element or node to start traversing on.

@param whatToShow

The type of nodes or elements to appear in the node list

@param filter

A custom NodeFilter function to use. For more information, see filter. Use null for no filter.

§
createProcessingInstruction(target: string, data: string): ProcessingInstruction
[src]

Returns a ProcessingInstruction node whose target is target and data is data. If target does not match the Name production an "InvalidCharacterError" DOMException will be thrown. If data contains "?>" an "InvalidCharacterError" DOMException will be thrown.

§
createRange(): Range
[src]

Returns an empty range object that has both of its boundary points positioned at the beginning of the document.

§
createTextNode(data: string): Text
[src]

Creates a text string from the specified value.

@param data

String that specifies the nodeValue property of the text node.

§
createTreeWalker(
root: Node,
whatToShow?: number,
filter?: NodeFilter | null,
): TreeWalker
[src]

Creates a TreeWalker object that you can use to traverse filtered lists of nodes or elements in a document.

@param root

The root element or node to start traversing on.

@param whatToShow

The type of nodes or elements to appear in the node list. For more information, see whatToShow.

@param filter

A custom NodeFilter function to use.

§
execCommand(
commandId: string,
showUI?: boolean,
value?: string,
): boolean
[src]

Executes a command on the current document, current selection, or the given range.

@param commandId

String that specifies the command to execute. This command can be any of the command identifiers that can be executed in script.

@param showUI

Display the user interface, defaults to false.

@param value

Value to assign.

§
exitFullscreen(): Promise<void>
[src]

Stops document's fullscreen element from being displayed fullscreen and resolves promise when done.

§
exitPictureInPicture(): Promise<void>
[src]
§
exitPointerLock(): void
[src]
§
getElementById(elementId: string): HTMLElement | null
[src]

Returns a reference to the first object with the specified value of the ID attribute.

@param elementId

String that specifies the ID value.

§
getElementsByClassName(classNames: string): HTMLCollectionOf<Element>
[src]

Returns a HTMLCollection of the elements in the object on which the method was invoked (a document or an element) that have all the classes given by classNames. The classNames argument is interpreted as a space-separated list of classes.

§
getElementsByName(elementName: string): NodeListOf<HTMLElement>
[src]

Gets a collection of objects based on the value of the NAME or ID attribute.

@param elementName

Gets a collection of objects based on the value of the NAME or ID attribute.

§
getElementsByTagName<K extends keyof HTMLElementTagNameMap>(qualifiedName: K): HTMLCollectionOf<HTMLElementTagNameMap[K]>
[src]

Retrieves a collection of objects based on the specified element name.

@param name

Specifies the name of an element.

§
getElementsByTagName<K extends keyof SVGElementTagNameMap>(qualifiedName: K): HTMLCollectionOf<SVGElementTagNameMap[K]>
[src]
§
getElementsByTagName(qualifiedName: string): HTMLCollectionOf<Element>
[src]
§
getElementsByTagNameNS(namespaceURI: "http://www.w3.org/1999/xhtml", localName: string): HTMLCollectionOf<HTMLElement>
[src]

If namespace and localName are "*" returns a HTMLCollection of all descendant elements.

If only namespace is "*" returns a HTMLCollection of all descendant elements whose local name is localName.

If only localName is "*" returns a HTMLCollection of all descendant elements whose namespace is namespace.

Otherwise, returns a HTMLCollection of all descendant elements whose namespace is namespace and local name is localName.

§
getElementsByTagNameNS(namespaceURI: "http://www.w3.org/2000/svg", localName: string): HTMLCollectionOf<SVGElement>
[src]
§
getElementsByTagNameNS(namespace: string | null, localName: string): HTMLCollectionOf<Element>
[src]
§
getSelection(): Selection | null
[src]

Returns an object representing the current selection of the document that is loaded into the object displaying a webpage.

§
hasFocus(): boolean
[src]

Gets a value indicating whether the object currently has focus.

§
hasStorageAccess(): Promise<boolean>
[src]
§
importNode<T extends Node>(node: T, deep?: boolean): T
[src]

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

If node is a document or a shadow root, throws a "NotSupportedError" DOMException.

§
get location(): Location
[src]

Contains information about the current URL.

§
set location(href: string | Location)
[src]
§
open(unused1?: string, unused2?: string): Document
[src]

Opens a new window and loads a document specified by a given URL. Also, opens a new window that uses the url parameter and the name parameter to collect the output of the write method and the writeln method.

@param url

Specifies a MIME type for the document.

@param name

Specifies the name of the window. This name is used as the value for the TARGET attribute on a form or an anchor element.

@param features

Contains a list of items separated by commas. Each item consists of an option and a value, separated by an equals sign (for example, "fullscreen=yes, toolbar=yes"). The following values are supported.

@param replace

Specifies whether the existing entry for the document is replaced in the history list.

§
open(
url: string | URL,
name: string,
features: string,
): WindowProxy | null
[src]
§
queryCommandEnabled(commandId: string): boolean
[src]

Returns a Boolean value that indicates whether a specified command can be successfully executed using execCommand, given the current state of the document.

@param commandId

Specifies a command identifier.

§
queryCommandIndeterm(commandId: string): boolean
[src]

Returns a Boolean value that indicates whether the specified command is in the indeterminate state.

@param commandId

String that specifies a command identifier.

§
queryCommandState(commandId: string): boolean
[src]

Returns a Boolean value that indicates the current state of the command.

@param commandId

String that specifies a command identifier.

§
queryCommandSupported(commandId: string): boolean
[src]

Returns a Boolean value that indicates whether the current command is supported on the current range.

@param commandId

Specifies a command identifier.

§
queryCommandValue(commandId: string): string
[src]

Returns the current value of the document, range, or current selection for the given command.

@param commandId

String that specifies a command identifier.

§
releaseEvents(): void
[src]
§
removeEventListener<K extends keyof DocumentEventMap>(
type: K,
listener: (this: Document, ev: DocumentEventMap[K]) => any,
options?: boolean | EventListenerOptions,
): void
[src]
§
removeEventListener(
type: string,
options?: boolean | EventListenerOptions,
): void
[src]
§
requestStorageAccess(): Promise<void>
[src]
§
write(...text: string[]): void
[src]

Writes one or more HTML expressions to a document in the specified window.

@param content

Specifies the text and HTML tags to write.

§
writeln(...text: string[]): void
[src]

Writes one or more HTML expressions, followed by a carriage return, to a document in the specified window.

@param content

The text and HTML tags to write.