Interface XMLDocument
activeElement: Element | null;
adoptedStyleSheets: CSSStyleSheet[];
alinkColor: string;
all: HTMLAllCollection;
anchors: HTMLCollectionOf<HTMLAnchorElement>;
applets: HTMLCollection;
ATTRIBUTE_NODE: 2;
baseURI: string;
bgColor: string;
body: HTMLElement;
CDATA_SECTION_NODE: 4;
characterSet: string;
charset: string;
childElementCount: number;
childNodes: NodeListOf<ChildNode>;
children: HTMLCollection;
COMMENT_NODE: 8;
compatMode: string;
contentType: string;
cookie: string;
currentScript: HTMLOrSVGScriptElement | null;
defaultView: Window & typeof globalThis | null;
designMode: string;
dir: string;
doctype: DocumentType | null;
DOCUMENT_FRAGMENT_NODE: 11;
DOCUMENT_NODE: 9;
DOCUMENT_POSITION_CONTAINED_BY: 16;
DOCUMENT_POSITION_CONTAINS: 8;
DOCUMENT_POSITION_DISCONNECTED: 1;
DOCUMENT_POSITION_FOLLOWING: 4;
DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: 32;
DOCUMENT_POSITION_PRECEDING: 2;
DOCUMENT_TYPE_NODE: 10;
documentElement: HTMLElement;
documentURI: string;
domain: string;
ELEMENT_NODE: 1;
embeds: HTMLCollectionOf<HTMLEmbedElement>;
ENTITY_NODE: 6;
ENTITY_REFERENCE_NODE: 5;
fgColor: string;
firstChild: ChildNode | null;
firstElementChild: Element | null;
fonts: FontFaceSet;
forms: HTMLCollectionOf<HTMLFormElement>;
fragmentDirective: FragmentDirective;
fullscreen: boolean;
fullscreenElement: Element | null;
fullscreenEnabled: boolean;
head: HTMLHeadElement;
hidden: boolean;
images: HTMLCollectionOf<HTMLImageElement>;
implementation: DOMImplementation;
inputEncoding: string;
isConnected: boolean;
lastChild: ChildNode | null;
lastElementChild: Element | null;
lastModified: string;
linkColor: string;
links: HTMLCollectionOf<HTMLAnchorElement | HTMLAreaElement>;
nextSibling: ChildNode | null;
nodeName: string;
nodeType: number;
nodeValue: string | null;
NOTATION_NODE: 12;
onabort: ((this: GlobalEventHandlers, ev: UIEvent) => any) | null;
onanimationcancel:
| ((this: GlobalEventHandlers, ev: AnimationEvent) => any)
| null;
onanimationend:
| ((this: GlobalEventHandlers, ev: AnimationEvent) => any)
| null;
onanimationiteration:
| ((this: GlobalEventHandlers, ev: AnimationEvent) => any)
| null;
onanimationstart:
| ((this: GlobalEventHandlers, ev: AnimationEvent) => any)
| null;
onauxclick: ((this: GlobalEventHandlers, ev: PointerEvent) => any) | null;
onbeforeinput: ((this: GlobalEventHandlers, ev: InputEvent) => any) | null;
onbeforematch: ((this: GlobalEventHandlers, ev: Event) => any) | null;
onbeforetoggle:
| ((this: GlobalEventHandlers, ev: ToggleEvent) => any)
| null;
onblur: ((this: GlobalEventHandlers, ev: FocusEvent) => any) | null;
oncancel: ((this: GlobalEventHandlers, ev: Event) => any) | null;
oncanplay: ((this: GlobalEventHandlers, ev: Event) => any) | null;
oncanplaythrough: ((this: GlobalEventHandlers, ev: Event) => any) | null;
onchange: ((this: GlobalEventHandlers, ev: Event) => any) | null;
onclick: ((this: GlobalEventHandlers, ev: PointerEvent) => any) | null;
onclose: ((this: GlobalEventHandlers, ev: Event) => any) | null;
oncontextlost: ((this: GlobalEventHandlers, ev: Event) => any) | null;
oncontextmenu:
| ((this: GlobalEventHandlers, ev: PointerEvent) => any)
| null;
oncontextrestored: ((this: GlobalEventHandlers, ev: Event) => any) | null;
oncopy: ((this: GlobalEventHandlers, ev: ClipboardEvent) => any) | null;
oncuechange: ((this: GlobalEventHandlers, ev: Event) => any) | null;
oncut: ((this: GlobalEventHandlers, ev: ClipboardEvent) => any) | null;
ondblclick: ((this: GlobalEventHandlers, ev: MouseEvent) => any) | null;
ondrag: ((this: GlobalEventHandlers, ev: DragEvent) => any) | null;
ondragend: ((this: GlobalEventHandlers, ev: DragEvent) => any) | null;
ondragenter: ((this: GlobalEventHandlers, ev: DragEvent) => any) | null;
ondragleave: ((this: GlobalEventHandlers, ev: DragEvent) => any) | null;
ondragover: ((this: GlobalEventHandlers, ev: DragEvent) => any) | null;
ondragstart: ((this: GlobalEventHandlers, ev: DragEvent) => any) | null;
ondrop: ((this: GlobalEventHandlers, ev: DragEvent) => any) | null;
ondurationchange: ((this: GlobalEventHandlers, ev: Event) => any) | null;
onemptied: ((this: GlobalEventHandlers, ev: Event) => any) | null;
onended: ((this: GlobalEventHandlers, ev: Event) => any) | null;
onerror: OnErrorEventHandler;
onfocus: ((this: GlobalEventHandlers, ev: FocusEvent) => any) | null;
onformdata: ((this: GlobalEventHandlers, ev: FormDataEvent) => any) | null;
onfullscreenchange: ((this: Document, ev: Event) => any) | null;
onfullscreenerror: ((this: Document, ev: Event) => any) | null;
ongotpointercapture:
| ((this: GlobalEventHandlers, ev: PointerEvent) => any)
| null;
oninput: ((this: GlobalEventHandlers, ev: Event) => any) | null;
oninvalid: ((this: GlobalEventHandlers, ev: Event) => any) | null;
onkeydown: ((this: GlobalEventHandlers, ev: KeyboardEvent) => any) | null;
onkeypress: ((this: GlobalEventHandlers, ev: KeyboardEvent) => any) | null;
onkeyup: ((this: GlobalEventHandlers, ev: KeyboardEvent) => any) | null;
onload: ((this: GlobalEventHandlers, ev: Event) => any) | null;
onloadeddata: ((this: GlobalEventHandlers, ev: Event) => any) | null;
onloadedmetadata: ((this: GlobalEventHandlers, ev: Event) => any) | null;
onloadstart: ((this: GlobalEventHandlers, ev: Event) => any) | null;
onlostpointercapture:
| ((this: GlobalEventHandlers, ev: PointerEvent) => any)
| null;
onmousedown: ((this: GlobalEventHandlers, ev: MouseEvent) => any) | null;
onmouseenter: ((this: GlobalEventHandlers, ev: MouseEvent) => any) | null;
onmouseleave: ((this: GlobalEventHandlers, ev: MouseEvent) => any) | null;
onmousemove: ((this: GlobalEventHandlers, ev: MouseEvent) => any) | null;
onmouseout: ((this: GlobalEventHandlers, ev: MouseEvent) => any) | null;
onmouseover: ((this: GlobalEventHandlers, ev: MouseEvent) => any) | null;
onmouseup: ((this: GlobalEventHandlers, ev: MouseEvent) => any) | null;
onpaste: ((this: GlobalEventHandlers, ev: ClipboardEvent) => any) | null;
onpause: ((this: GlobalEventHandlers, ev: Event) => any) | null;
onplay: ((this: GlobalEventHandlers, ev: Event) => any) | null;
onplaying: ((this: GlobalEventHandlers, ev: Event) => any) | null;
onpointercancel:
| ((this: GlobalEventHandlers, ev: PointerEvent) => any)
| null;
onpointerdown:
| ((this: GlobalEventHandlers, ev: PointerEvent) => any)
| null;
onpointerenter:
| ((this: GlobalEventHandlers, ev: PointerEvent) => any)
| null;
onpointerleave:
| ((this: GlobalEventHandlers, ev: PointerEvent) => any)
| null;
onpointerlockchange: ((this: Document, ev: Event) => any) | null;
onpointerlockerror: ((this: Document, ev: Event) => any) | null;
onpointermove:
| ((this: GlobalEventHandlers, ev: PointerEvent) => any)
| null;
onpointerout: ((this: GlobalEventHandlers, ev: PointerEvent) => any) | null;
onpointerover:
| ((this: GlobalEventHandlers, ev: PointerEvent) => any)
| null;
onpointerrawupdate: ((this: GlobalEventHandlers, ev: Event) => any) | null;
onpointerup: ((this: GlobalEventHandlers, ev: PointerEvent) => any) | null;
onprogress: ((this: GlobalEventHandlers, ev: ProgressEvent) => any) | null;
onratechange: ((this: GlobalEventHandlers, ev: Event) => any) | null;
onreadystatechange: ((this: Document, ev: Event) => any) | null;
onreset: ((this: GlobalEventHandlers, ev: Event) => any) | null;
onresize: ((this: GlobalEventHandlers, ev: UIEvent) => any) | null;
onscroll: ((this: GlobalEventHandlers, ev: Event) => any) | null;
onscrollend: ((this: GlobalEventHandlers, ev: Event) => any) | null;
onsecuritypolicyviolation:
| (
(this: GlobalEventHandlers, ev: SecurityPolicyViolationEvent) => any
)
| null;
onseeked: ((this: GlobalEventHandlers, ev: Event) => any) | null;
onseeking: ((this: GlobalEventHandlers, ev: Event) => any) | null;
onselect: ((this: GlobalEventHandlers, ev: Event) => any) | null;
onselectionchange: ((this: GlobalEventHandlers, ev: Event) => any) | null;
onselectstart: ((this: GlobalEventHandlers, ev: Event) => any) | null;
onslotchange: ((this: GlobalEventHandlers, ev: Event) => any) | null;
onstalled: ((this: GlobalEventHandlers, ev: Event) => any) | null;
onsubmit: ((this: GlobalEventHandlers, ev: SubmitEvent) => any) | null;
onsuspend: ((this: GlobalEventHandlers, ev: Event) => any) | null;
ontimeupdate: ((this: GlobalEventHandlers, ev: Event) => any) | null;
ontoggle: ((this: GlobalEventHandlers, ev: ToggleEvent) => any) | null;
ontouchcancel?: ((this: GlobalEventHandlers, ev: TouchEvent) => any) | null;
ontouchend?: ((this: GlobalEventHandlers, ev: TouchEvent) => any) | null;
ontouchmove?: ((this: GlobalEventHandlers, ev: TouchEvent) => any) | null;
ontouchstart?: ((this: GlobalEventHandlers, ev: TouchEvent) => any) | null;
ontransitioncancel:
| ((this: GlobalEventHandlers, ev: TransitionEvent) => any)
| null;
ontransitionend:
| ((this: GlobalEventHandlers, ev: TransitionEvent) => any)
| null;
ontransitionrun:
| ((this: GlobalEventHandlers, ev: TransitionEvent) => any)
| null;
ontransitionstart:
| ((this: GlobalEventHandlers, ev: TransitionEvent) => any)
| null;
onvisibilitychange: ((this: Document, ev: Event) => any) | null;
onvolumechange: ((this: GlobalEventHandlers, ev: Event) => any) | null;
onwaiting: ((this: GlobalEventHandlers, ev: Event) => any) | null;
onwebkitanimationend:
| ((this: GlobalEventHandlers, ev: Event) => any)
| null;
onwebkitanimationiteration:
| ((this: GlobalEventHandlers, ev: Event) => any)
| null;
onwebkitanimationstart:
| ((this: GlobalEventHandlers, ev: Event) => any)
| null;
onwebkittransitionend:
| ((this: GlobalEventHandlers, ev: Event) => any)
| null;
onwheel: ((this: GlobalEventHandlers, ev: WheelEvent) => any) | null;
ownerDocument: null;
parentElement: HTMLElement | null;
parentNode: ParentNode | null;
pictureInPictureElement: Element | null;
pictureInPictureEnabled: boolean;
plugins: HTMLCollectionOf<HTMLEmbedElement>;
pointerLockElement: Element | null;
previousSibling: ChildNode | null;
PROCESSING_INSTRUCTION_NODE: 7;
readyState: DocumentReadyState;
referrer: string;
rootElement: SVGSVGElement | null;
scripts: HTMLCollectionOf<HTMLScriptElement>;
scrollingElement: Element | null;
styleSheets: StyleSheetList;
TEXT_NODE: 3;
timeline: DocumentTimeline;
title: string;
URL: string;
visibilityState: DocumentVisibilityState;
vlinkColor: string;
get location(): Location;
set location(href: string): void;
get textContent(): null;
addEventListener<K extends keyof DocumentEventMap>(
type: K,
listener: (this: XMLDocument, ev: DocumentEventMap[K]) => any,
options?: boolean | AddEventListenerOptions,
): void;
addEventListener(
type: string,
listener: EventListenerOrEventListenerObject,
options?: boolean | AddEventListenerOptions,
): void;
adoptNode<T extends Node>(node: T): T;
append(...nodes: (string | Node)[]): void;
appendChild<T extends Node>(node: T): T;
captureEvents(): void;
caretPositionFromPoint(
x: number,
y: number,
options?: CaretPositionFromPointOptions,
): CaretPosition | null;
caretRangeFromPoint(x: number, y: number): Range | null;
clear(): void;
cloneNode(subtree?: boolean): Node;
close(): void;
compareDocumentPosition(other: Node): number;
contains(other: Node | null): boolean;
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<K extends keyof MathMLElementTagNameMap>(
namespaceURI: "http://www.w3.org/1998/Math/MathML",
qualifiedName: K,
): MathMLElementTagNameMap[K];
createElementNS(
namespaceURI: "http://www.w3.org/1998/Math/MathML",
qualifiedName: string,
): MathMLElement;
createElementNS(
namespaceURI: string | null,
qualifiedName: string,
options?: ElementCreationOptions,
): 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: "ContentVisibilityAutoStateChangeEvent",
): ContentVisibilityAutoStateChangeEvent;
createEvent(eventInterface: "CookieChangeEvent"): CookieChangeEvent;
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: "MIDIConnectionEvent"): MIDIConnectionEvent;
createEvent(eventInterface: "MIDIMessageEvent"): MIDIMessageEvent;
createEvent(eventInterface: "MediaEncryptedEvent"): MediaEncryptedEvent;
createEvent(eventInterface: "MediaKeyMessageEvent"): MediaKeyMessageEvent;
createEvent(eventInterface: "MediaQueryListEvent"): MediaQueryListEvent;
createEvent(eventInterface: "MediaStreamTrackEvent"): MediaStreamTrackEvent;
createEvent(eventInterface: "MessageEvent"): MessageEvent;
createEvent(eventInterface: "MouseEvent"): MouseEvent;
createEvent(eventInterface: "MouseEvents"): MouseEvent;
createEvent(
eventInterface: "OfflineAudioCompletionEvent",
): OfflineAudioCompletionEvent;
createEvent(eventInterface: "PageRevealEvent"): PageRevealEvent;
createEvent(eventInterface: "PageSwapEvent"): PageSwapEvent;
createEvent(eventInterface: "PageTransitionEvent"): PageTransitionEvent;
createEvent(
eventInterface: "PaymentMethodChangeEvent",
): PaymentMethodChangeEvent;
createEvent(
eventInterface: "PaymentRequestUpdateEvent",
): PaymentRequestUpdateEvent;
createEvent(eventInterface: "PictureInPictureEvent"): PictureInPictureEvent;
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: "TextEvent"): TextEvent;
createEvent(eventInterface: "ToggleEvent"): ToggleEvent;
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;
createExpression(
expression: string,
resolver?: XPathNSResolver | null,
): XPathExpression;
createNodeIterator(
root: Node,
whatToShow?: number,
filter?: NodeFilter | null,
): NodeIterator;
createNSResolver(nodeResolver: Node): Node;
createProcessingInstruction(
target: string,
data: string,
): ProcessingInstruction;
createRange(): Range;
createTextNode(data: string): Text;
createTreeWalker(
root: Node,
whatToShow?: number,
filter?: NodeFilter | null,
): TreeWalker;
dispatchEvent(event: Event): boolean;
elementFromPoint(x: number, y: number): Element | null;
elementsFromPoint(x: number, y: number): Element[];
evaluate(
expression: string,
contextNode: Node,
resolver?: XPathNSResolver | null,
type?: number,
result?: XPathResult | null,
): XPathResult;
execCommand(commandId: string, showUI?: boolean, value?: string): boolean;
exitFullscreen(): Promise<void>;
exitPictureInPicture(): Promise<void>;
exitPointerLock(): void;
getAnimations(): Animation[];
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<K extends keyof MathMLElementTagNameMap>(
qualifiedName: K,
): HTMLCollectionOf<MathMLElementTagNameMap[K]>;
getElementsByTagName<K extends keyof HTMLElementDeprecatedTagNameMap>(
qualifiedName: K,
): HTMLCollectionOf<HTMLElementDeprecatedTagNameMap[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(
namespaceURI: "http://www.w3.org/1998/Math/MathML",
localName: string,
): HTMLCollectionOf<MathMLElement>;
getElementsByTagNameNS(
namespace: string | null,
localName: string,
): HTMLCollectionOf<Element>;
getRootNode(options?: GetRootNodeOptions): Node;
getSelection(): Selection | null;
hasChildNodes(): boolean;
hasFocus(): boolean;
hasStorageAccess(): Promise<boolean>;
importNode<T extends Node>(
node: T,
options?: boolean | ImportNodeOptions,
): T;
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;
open(unused1?: string, unused2?: string): Document;
open(url: string | URL, name: string, features: string): Window | null;
prepend(...nodes: (string | Node)[]): void;
queryCommandEnabled(commandId: string): boolean;
queryCommandIndeterm(commandId: string): boolean;
queryCommandState(commandId: string): boolean;
queryCommandSupported(commandId: string): boolean;
queryCommandValue(commandId: string): string;
querySelector<K extends keyof HTMLElementTagNameMap>(
selectors: K,
): HTMLElementTagNameMap[K] | null;
querySelector<K extends keyof SVGElementTagNameMap>(
selectors: K,
): SVGElementTagNameMap[K] | null;
querySelector<K extends keyof MathMLElementTagNameMap>(
selectors: K,
): MathMLElementTagNameMap[K] | null;
querySelector<K extends keyof HTMLElementDeprecatedTagNameMap>(
selectors: K,
): HTMLElementDeprecatedTagNameMap[K] | null;
querySelector<E extends Element = Element>(selectors: string): E | null;
querySelectorAll<K extends keyof HTMLElementTagNameMap>(
selectors: K,
): NodeListOf<HTMLElementTagNameMap[K]>;
querySelectorAll<K extends keyof SVGElementTagNameMap>(
selectors: K,
): NodeListOf<SVGElementTagNameMap[K]>;
querySelectorAll<K extends keyof MathMLElementTagNameMap>(
selectors: K,
): NodeListOf<MathMLElementTagNameMap[K]>;
querySelectorAll<K extends keyof HTMLElementDeprecatedTagNameMap>(
selectors: K,
): NodeListOf<HTMLElementDeprecatedTagNameMap[K]>;
querySelectorAll<E extends Element = Element>(
selectors: string,
): NodeListOf<E>;
releaseEvents(): void;
removeChild<T extends Node>(child: T): T;
removeEventListener<K extends keyof DocumentEventMap>(
type: K,
listener: (this: XMLDocument, ev: DocumentEventMap[K]) => any,
options?: boolean | EventListenerOptions,
): void;
removeEventListener(
type: string,
listener: EventListenerOrEventListenerObject,
options?: boolean | EventListenerOptions,
): void;
replaceChild<T extends Node>(node: Node, child: T): T;
replaceChildren(...nodes: (string | Node)[]): void;
requestStorageAccess(): Promise<void>;
startViewTransition(
callbackOptions?:
| ViewTransitionUpdateCallback
| StartViewTransitionOptions,
): ViewTransition;
write(...text: string[]): void;
writeln(...text: string[]): void;
}
Hierarchy
- Document
- XMLDocument (View Summary)
Index
Properties
Accessors
Methods
Properties
ReadonlyactiveElement
Returns the deepest element in the document through which or to which key events are being routed. This is, roughly speaking, the focused element in the document.
For the purposes of this API, when a child browsing context is focused, its container is focused in the parent browsing context. For example, if the user moves the focus to a text control in an iframe, the iframe is the element returned by the activeElement API in the iframe's node document.
Similarly, when the focused element is in a different node tree than documentOrShadowRoot, the element returned will be the host that's located in the same node tree as documentOrShadowRoot if documentOrShadowRoot is a shadow-including inclusive ancestor of the focused element, and null if not.
adoptedStyleSheets
alinkColor
Returns or sets the color of an active link in the document body.
Readonlyall
The Document interface's read-only all property returns an HTMLAllCollection rooted at the document node.
Readonlyanchors
The anchors read-only property of the An HTMLCollection.
Readonlyapplets
The applets property of the Document returns an empty HTMLCollection.
ReadonlyATTRIBUTE_NODE
ReadonlybaseURI
The read-only baseURI property of the Node interface returns the absolute base URL of the document containing the node.
bgColor
The deprecated bgColor property gets or sets the background color of the current document.
body
The Document.body property represents the null if no such element exists.
ReadonlyCDATA_SECTION_NODE
node is a CDATASection node.
ReadonlycharacterSet
The Document.characterSet read-only property returns the character encoding of the document that it's currently rendered with.
Readonlycharset
ReadonlychildElementCount
ReadonlychildNodes
The read-only childNodes property of the Node interface returns a live the first child node is assigned index 0.
Readonlychildren
Returns the child elements.
ReadonlyCOMMENT_NODE
node is a Comment node.
ReadonlycompatMode
The Document.compatMode read-only property indicates whether the document is rendered in Quirks mode or Standards mode.
ReadonlycontentType
The Document.contentType read-only property returns the MIME type that the document is being rendered as.
cookie
The Document property cookie lets you read and write cookies associated with the document.
ReadonlycurrentScript
The Document.currentScript property returns the script element whose script is currently being processed and isn't a JavaScript module.
ReadonlydefaultView
In browsers, document.defaultView returns the This property is read-only.
designMode
document.designMode controls whether the entire document is editable.
dir
The Document.dir property is a string representing the directionality of the text of the document, whether left to right (default) or right to left.
Readonlydoctype
The doctype read-only property of the Document interface is a DocumentType object representing the Doctype associated with the current document.
ReadonlyDOCUMENT_FRAGMENT_NODE
node is a DocumentFragment node.
ReadonlyDOCUMENT_NODE
node is a document.
ReadonlyDOCUMENT_POSITION_CONTAINED_BY
Set when other is a descendant of node.
ReadonlyDOCUMENT_POSITION_CONTAINS
Set when other is an ancestor of node.
ReadonlyDOCUMENT_POSITION_DISCONNECTED
Set when node and other are not in the same tree.
ReadonlyDOCUMENT_POSITION_FOLLOWING
Set when other is following node.
ReadonlyDOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC
ReadonlyDOCUMENT_POSITION_PRECEDING
Set when other is preceding node.
ReadonlyDOCUMENT_TYPE_NODE
node is a doctype.
ReadonlydocumentElement
The documentElement read-only property of the Document interface returns the example, the html element for HTML documents).
ReadonlydocumentURI
The documentURI read-only property of the A string.
domain
The domain property of the Document interface gets/sets the domain portion of the origin of the current document, as used by the same-origin policy.
ReadonlyELEMENT_NODE
node is an element.
Readonlyembeds
The embeds read-only property of the An HTMLCollection.
ReadonlyENTITY_NODE
ReadonlyENTITY_REFERENCE_NODE
fgColor
fgColor gets/sets the foreground color, or text color, of the current document.
ReadonlyfirstChild
The read-only firstChild property of the Node interface returns the node's first child in the tree, or null if the node has no children.
ReadonlyfirstElementChild
Returns the first child that is an element, and null otherwise.
Readonlyfonts
Readonlyforms
The forms read-only property of the Document interface returns an HTMLCollection listing all the form elements contained in the document.
ReadonlyfragmentDirective
The fragmentDirective read-only property of the Document interface returns the FragmentDirective for the current document.
Readonlyfullscreen
The obsolete Document interface's fullscreen read-only property reports whether or not the document is currently displaying content in fullscreen mode.
ReadonlyfullscreenElement
Returns document's fullscreen element.
ReadonlyfullscreenEnabled
The read-only fullscreenEnabled property on the Document interface indicates whether or not fullscreen mode is available.
Readonlyhead
The head read-only property of the Document interface returns the head element of the current document.
Readonlyhidden
The Document.hidden read-only property returns a Boolean value indicating if the page is considered hidden or not.
Readonlyimages
The images read-only property of the Document interface returns a collection of the images in the current HTML document.
Readonlyimplementation
The Document.implementation property returns a A DOMImplementation object.
ReadonlyinputEncoding
ReadonlyisConnected
The read-only isConnected property of the Node interface returns a boolean indicating whether the node is connected (directly or indirectly) to a Document object.
ReadonlylastChild
The read-only lastChild property of the Node interface returns the last child of the node, or null if there are no child nodes.
ReadonlylastElementChild
Returns the last child that is an element, and null otherwise.
ReadonlylastModified
The lastModified property of the Document interface returns a string containing the date and local time on which the current document was last modified.
linkColor
The Document.linkColor property gets/sets the color of links within the document.
Readonlylinks
The links read-only property of the Document interface returns a collection of all area elements and a elements in a document with a value for the href attribute.
ReadonlynextSibling
The read-only nextSibling property of the Node interface returns the node immediately following the specified one in their parent's Node.childNodes, or returns null if the specified node is the last child in the parent element.
ReadonlynodeName
The read-only nodeName property of Node returns the name of the current node as a string.
ReadonlynodeType
The read-only nodeType property of a Node interface is an integer that identifies what the node is.
nodeValue
The nodeValue property of the Node interface returns or sets the value of the current node.
ReadonlyNOTATION_NODE
onabort
onanimationcancel
onanimationend
onanimationiteration
onanimationstart
onauxclick
onbeforeinput
onbeforematch
onbeforetoggle
onblur
oncancel
oncanplay
oncanplaythrough
onchange
onclick
onclose
oncontextlost
oncontextmenu
oncontextrestored
oncopy
oncuechange
oncut
ondblclick
ondrag
ondragend
ondragenter
ondragleave
ondragover
ondragstart
ondrop
ondurationchange
onemptied
onended
onerror
onfocus
onformdata
onfullscreenchange
onfullscreenerror
ongotpointercapture
oninput
oninvalid
onkeydown
onkeypress
onkeyup
onload
onloadeddata
onloadedmetadata
onloadstart
onlostpointercapture
onmousedown
onmouseenter
onmouseleave
onmousemove
onmouseout
onmouseover
onmouseup
onpaste
onpause
onplay
onplaying
onpointercancel
onpointerdown
onpointerenter
onpointerleave
onpointerlockchange
onpointerlockerror
onpointermove
onpointerout
onpointerover
onpointerrawupdate
Available only in secure contexts.
onpointerup
onprogress
onratechange
onreadystatechange
onreset
onresize
onscroll
onscrollend
onsecuritypolicyviolation
| ((this: GlobalEventHandlers, ev: SecurityPolicyViolationEvent) => any)
| null
onseeked
onseeking
onselect
onselectionchange
onselectstart
onslotchange
onstalled
onsubmit
onsuspend
ontimeupdate
ontoggle
Optionalontouchcancel
Optionalontouchend
Optionalontouchmove
Optionalontouchstart
ontransitioncancel
ontransitionend
ontransitionrun
ontransitionstart
onvisibilitychange
onvolumechange
onwaiting
onwebkitanimationend
onwebkitanimationiteration
onwebkitanimationstart
onwebkittransitionend
onwheel
ReadonlyownerDocument
The read-only ownerDocument property of the Node interface returns the top-level document object of the node.
ReadonlyparentElement
The read-only parentElement property of Node interface returns the DOM node's parent Element, or null if the node either has no parent, or its parent isn't a DOM Element.
ReadonlyparentNode
The read-only parentNode property of the Node interface returns the parent of the specified node in the DOM tree.
ReadonlypictureInPictureElement
ReadonlypictureInPictureEnabled
The read-only pictureInPictureEnabled property of the available.
Readonlyplugins
The plugins read-only property of the containing one or more HTMLEmbedElements representing the An HTMLCollection.
ReadonlypointerLockElement
ReadonlypreviousSibling
The read-only previousSibling property of the Node interface returns the node immediately preceding the specified one in its parent's or null if the specified node is the first in that list.
ReadonlyPROCESSING_INSTRUCTION_NODE
node is a ProcessingInstruction node.
ReadonlyreadyState
The Document.readyState property describes the loading state of the document.
Readonlyreferrer
The Document.referrer property returns the URI of the page that linked to this page.
ReadonlyrootElement
Document.rootElement returns the Element that is the root element of the document if it is an documents.
Readonlyscripts
The scripts property of the Document interface returns a list of the script elements in the document.
ReadonlyscrollingElement
The scrollingElement read-only property of the scrolls the document.
ReadonlystyleSheets
ReadonlyTEXT_NODE
node is a Text node.
Readonlytimeline
The timeline readonly property of the Document interface represents the default timeline of the current document.
title
The document.title property gets or sets the current title of the document.
ReadonlyURL
The URL read-only property of the Document interface returns the document location as a string.
ReadonlyvisibilityState
The Document.visibilityState read-only property returns the visibility of the document.
vlinkColor
The Document.vlinkColor property gets/sets the color of links that the user has visited in the document.
Accessors
location
The
Document.locationread-only property returns a and provides methods for changing that URL and loading another URL.Returns Location
- set location(href: string): void
Parameters
- href: string
Returns void
textContent
- get textContent(): null
Returns null
Methods
addEventListener
- addEventListener<K extends keyof DocumentEventMap>(
type: K,
listener: (this: XMLDocument, ev: DocumentEventMap[K]) => any,
options?: boolean | AddEventListenerOptions,
): voidThe
addEventListener()method of the EventTarget interface sets up a function that will be called whenever the specified event is delivered to the target.Type Parameters
- K extends keyof DocumentEventMap
Parameters
- type: K
- listener: (this: XMLDocument, ev: DocumentEventMap[K]) => any
Optionaloptions: boolean | AddEventListenerOptions
Returns void
- addEventListener(
type: string,
listener: EventListenerOrEventListenerObject,
options?: boolean | AddEventListenerOptions,
): voidThe
addEventListener()method of the EventTarget interface sets up a function that will be called whenever the specified event is delivered to the target.Parameters
- type: string
- listener: EventListenerOrEventListenerObject
Optionaloptions: boolean | AddEventListenerOptions
Returns void
adoptNode
append
Inserts nodes after the last child of node, while replacing strings in nodes with equivalent Text nodes.
Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated.
Parameters
- ...nodes: (string | Node)[]
Returns void
appendChild
captureEvents
caretPositionFromPoint
- caretPositionFromPoint(
x: number,
y: number,
options?: CaretPositionFromPointOptions,
): CaretPosition | nullThe
caretPositionFromPoint()method of the Document interface returns a CaretPosition object, containing the DOM node, along with the caret and caret's character offset within that node.Parameters
- x: number
- y: number
Optionaloptions: CaretPositionFromPointOptions
Returns CaretPosition | null
caretRangeFromPoint
clear
cloneNode
The
cloneNode()method of the Node interface returns a duplicate of the node on which this method was called.Parameters
Optionalsubtree: boolean
Returns Node
close
The
Document.close()method finishes writing to a document, opened with Document.open().Returns void
compareDocumentPosition
The
compareDocumentPosition()method of the Node interface reports the position of its argument node relative to the node on which it is called.Parameters
- other: Node
Returns number
contains
The
contains()method of the Node interface returns a boolean value indicating whether a node is a descendant of a given node, that is the node itself, one of its direct children (Node.childNodes), one of the children's direct children, and so on.Parameters
- other: Node | null
Returns boolean
createAttribute
The
Document.createAttribute()method creates a new attribute node, and returns it.Parameters
- localName: string
Returns Attr
createAttributeNS
The
Document.createAttributeNS()method creates a new attribute node with the specified namespace URI and qualified name, and returns it.Parameters
- namespace: string | null
- qualifiedName: string
Returns Attr
createCDATASection
createCDATASection()creates a new CDATA section node, and returns it.Parameters
- data: string
Returns CDATASection
createComment
createDocumentFragment
Creates a new empty DocumentFragment into which DOM nodes can be added to build an offscreen DOM tree.
Returns DocumentFragment
createElement
- createElement<K extends keyof HTMLElementTagNameMap>(
tagName: K,
options?: ElementCreationOptions,
): HTMLElementTagNameMap[K]In an HTML document, the
document.createElement()method creates the HTML element specified bylocalName, or an HTMLUnknownElement iflocalNameisn't recognized.Type Parameters
- K extends keyof HTMLElementTagNameMap
Parameters
- tagName: K
Optionaloptions: ElementCreationOptions
Returns HTMLElementTagNameMap[K]
- createElement<K extends keyof HTMLElementDeprecatedTagNameMap>(
tagName: K,
options?: ElementCreationOptions,
): HTMLElementDeprecatedTagNameMap[K]Type Parameters
- K extends keyof HTMLElementDeprecatedTagNameMap
Parameters
- tagName: K
Optionaloptions: ElementCreationOptions
Returns HTMLElementDeprecatedTagNameMap[K]
Parameters
- tagName: string
Optionaloptions: ElementCreationOptions
Returns HTMLElement
createElementNS
Creates an element with the specified namespace URI and qualified name.
Parameters
- namespaceURI: "http://www.w3.org/1999/xhtml"
- qualifiedName: string
Returns HTMLElement
- createElementNS<K extends keyof SVGElementTagNameMap>(
namespaceURI: "http://www.w3.org/2000/svg",
qualifiedName: K,
): SVGElementTagNameMap[K]Type Parameters
- K extends keyof SVGElementTagNameMap
Parameters
- namespaceURI: "http://www.w3.org/2000/svg"
- qualifiedName: K
Returns SVGElementTagNameMap[K]
Parameters
- namespaceURI: "http://www.w3.org/2000/svg"
- qualifiedName: string
Returns SVGElement
- createElementNS<K extends keyof MathMLElementTagNameMap>(
namespaceURI: "http://www.w3.org/1998/Math/MathML",
qualifiedName: K,
): MathMLElementTagNameMap[K]Type Parameters
- K extends keyof MathMLElementTagNameMap
Parameters
- namespaceURI: "http://www.w3.org/1998/Math/MathML"
- qualifiedName: K
Returns MathMLElementTagNameMap[K]
- createElementNS(
namespaceURI: "http://www.w3.org/1998/Math/MathML",
qualifiedName: string,
): MathMLElementParameters
- namespaceURI: "http://www.w3.org/1998/Math/MathML"
- qualifiedName: string
Returns MathMLElement
- createElementNS(
namespaceURI: string | null,
qualifiedName: string,
options?: ElementCreationOptions,
): ElementParameters
- namespaceURI: string | null
- qualifiedName: string
Optionaloptions: ElementCreationOptions
Returns Element
- createElementNS(
namespace: string | null,
qualifiedName: string,
options?: string | ElementCreationOptions,
): ElementParameters
- namespace: string | null
- qualifiedName: string
Optionaloptions: string | ElementCreationOptions
Returns Element
createEvent
Creates an event of the type specified.
Parameters
- eventInterface: "AnimationEvent"
Returns AnimationEvent
Parameters
- eventInterface: "AnimationPlaybackEvent"
Returns AnimationPlaybackEvent
Parameters
- eventInterface: "AudioProcessingEvent"
Returns AudioProcessingEvent
Parameters
- eventInterface: "BeforeUnloadEvent"
Returns BeforeUnloadEvent
Parameters
- eventInterface: "BlobEvent"
Returns BlobEvent
Parameters
- eventInterface: "ClipboardEvent"
Returns ClipboardEvent
Parameters
- eventInterface: "CloseEvent"
Returns CloseEvent
Parameters
- eventInterface: "CompositionEvent"
Returns CompositionEvent
- createEvent(
eventInterface: "ContentVisibilityAutoStateChangeEvent",
): ContentVisibilityAutoStateChangeEventParameters
- eventInterface: "ContentVisibilityAutoStateChangeEvent"
Returns ContentVisibilityAutoStateChangeEvent
Parameters
- eventInterface: "CookieChangeEvent"
Returns CookieChangeEvent
Parameters
- eventInterface: "CustomEvent"
Returns CustomEvent
Parameters
- eventInterface: "DeviceMotionEvent"
Returns DeviceMotionEvent
Parameters
- eventInterface: "DeviceOrientationEvent"
Returns DeviceOrientationEvent
Parameters
- eventInterface: "DragEvent"
Returns DragEvent
Parameters
- eventInterface: "ErrorEvent"
Returns ErrorEvent
Parameters
- eventInterface: "Event"
Returns Event
Parameters
- eventInterface: "Events"
Returns Event
Parameters
- eventInterface: "FocusEvent"
Returns FocusEvent
Parameters
- eventInterface: "FontFaceSetLoadEvent"
Returns FontFaceSetLoadEvent
Parameters
- eventInterface: "FormDataEvent"
Returns FormDataEvent
Parameters
- eventInterface: "GamepadEvent"
Returns GamepadEvent
Parameters
- eventInterface: "HashChangeEvent"
Returns HashChangeEvent
Parameters
- eventInterface: "IDBVersionChangeEvent"
Returns IDBVersionChangeEvent
Parameters
- eventInterface: "InputEvent"
Returns InputEvent
Parameters
- eventInterface: "KeyboardEvent"
Returns KeyboardEvent
Parameters
- eventInterface: "MIDIConnectionEvent"
Returns MIDIConnectionEvent
Parameters
- eventInterface: "MIDIMessageEvent"
Returns MIDIMessageEvent
Parameters
- eventInterface: "MediaEncryptedEvent"
Returns MediaEncryptedEvent
Parameters
- eventInterface: "MediaKeyMessageEvent"
Returns MediaKeyMessageEvent
Parameters
- eventInterface: "MediaQueryListEvent"
Returns MediaQueryListEvent
Parameters
- eventInterface: "MediaStreamTrackEvent"
Returns MediaStreamTrackEvent
Parameters
- eventInterface: "MessageEvent"
Returns MessageEvent
Parameters
- eventInterface: "MouseEvent"
Returns MouseEvent
Parameters
- eventInterface: "MouseEvents"
Returns MouseEvent
Parameters
- eventInterface: "OfflineAudioCompletionEvent"
Returns OfflineAudioCompletionEvent
Parameters
- eventInterface: "PageRevealEvent"
Returns PageRevealEvent
Parameters
- eventInterface: "PageSwapEvent"
Returns PageSwapEvent
Parameters
- eventInterface: "PageTransitionEvent"
Returns PageTransitionEvent
Parameters
- eventInterface: "PaymentMethodChangeEvent"
Returns PaymentMethodChangeEvent
Parameters
- eventInterface: "PaymentRequestUpdateEvent"
Returns PaymentRequestUpdateEvent
Parameters
- eventInterface: "PictureInPictureEvent"
Returns PictureInPictureEvent
Parameters
- eventInterface: "PointerEvent"
Returns PointerEvent
Parameters
- eventInterface: "PopStateEvent"
Returns PopStateEvent
Parameters
- eventInterface: "ProgressEvent"
Returns ProgressEvent
Parameters
- eventInterface: "PromiseRejectionEvent"
Returns PromiseRejectionEvent
Parameters
- eventInterface: "RTCDTMFToneChangeEvent"
Returns RTCDTMFToneChangeEvent
Parameters
- eventInterface: "RTCDataChannelEvent"
Returns RTCDataChannelEvent
Parameters
- eventInterface: "RTCErrorEvent"
Returns RTCErrorEvent
Parameters
- eventInterface: "RTCPeerConnectionIceErrorEvent"
Returns RTCPeerConnectionIceErrorEvent
Parameters
- eventInterface: "RTCPeerConnectionIceEvent"
Returns RTCPeerConnectionIceEvent
Parameters
- eventInterface: "RTCTrackEvent"
Returns RTCTrackEvent
Parameters
- eventInterface: "SecurityPolicyViolationEvent"
Returns SecurityPolicyViolationEvent
Parameters
- eventInterface: "SpeechSynthesisErrorEvent"
Returns SpeechSynthesisErrorEvent
Parameters
- eventInterface: "SpeechSynthesisEvent"
Returns SpeechSynthesisEvent
Parameters
- eventInterface: "StorageEvent"
Returns StorageEvent
Parameters
- eventInterface: "SubmitEvent"
Returns SubmitEvent
Parameters
- eventInterface: "TextEvent"
Returns TextEvent
Parameters
- eventInterface: "ToggleEvent"
Returns ToggleEvent
Parameters
- eventInterface: "TouchEvent"
Returns TouchEvent
Parameters
- eventInterface: "TrackEvent"
Returns TrackEvent
Parameters
- eventInterface: "TransitionEvent"
Returns TransitionEvent
Parameters
- eventInterface: "UIEvent"
Returns UIEvent
Parameters
- eventInterface: "UIEvents"
Returns UIEvent
Parameters
- eventInterface: "WebGLContextEvent"
Returns WebGLContextEvent
Parameters
- eventInterface: "WheelEvent"
Returns WheelEvent
Parameters
- eventInterface: string
Returns Event
createExpression
Parameters
- expression: string
Optionalresolver: XPathNSResolver | null
Returns XPathExpression
createNodeIterator
The
Document.createNodeIterator()method returns a newNodeIteratorobject.Parameters
- root: Node
OptionalwhatToShow: numberOptionalfilter: NodeFilter | null
Returns NodeIterator
createNSResolver
createProcessingInstruction
createProcessingInstruction()generates a new processing instruction node and returns it.Parameters
- target: string
- data: string
Returns ProcessingInstruction
createRange
The
Document.createRange()method returns a newjs-nolint createRange()None.Returns Range
createTextNode
createTreeWalker
The
Document.createTreeWalker()creator method returns a newly created TreeWalker object.Parameters
- root: Node
OptionalwhatToShow: numberOptionalfilter: NodeFilter | null
Returns TreeWalker
dispatchEvent
The
dispatchEvent()method of the EventTarget sends an Event to the object, (synchronously) invoking the affected event listeners in the appropriate order.Parameters
- event: Event
Returns boolean
elementFromPoint
Parameters
- x: number
- y: number
Returns Element | null
elementsFromPoint
Parameters
- x: number
- y: number
Returns Element[]
evaluate
- evaluate(
expression: string,
contextNode: Node,
resolver?: XPathNSResolver | null,
type?: number,
result?: XPathResult | null,
): XPathResultParameters
- expression: string
- contextNode: Node
Optionalresolver: XPathNSResolver | nullOptionaltype: numberOptionalresult: XPathResult | null
Returns XPathResult
execCommand
exitFullscreen
The Document method
exitFullscreen()requests that the element on this document which is currently being presented in fullscreen mode be taken out of fullscreen mode, restoring the previous state of the screen.Returns Promise<void>
exitPictureInPicture
The
exitPictureInPicture()method of the Document interface requests that a video contained in this document, which is currently floating, be taken out of picture-in-picture mode, restoring the previous state of the screen.Returns Promise<void>
exitPointerLock
The
exitPointerLock()method of the Document interface asynchronously releases a pointer lock previously requested through Element.requestPointerLock.Returns void
getAnimations
Returns Animation[]
getElementById
Returns the first element within node's descendants whose ID is elementId.
Parameters
- elementId: string
Returns HTMLElement | null
getElementsByClassName
The
getElementsByClassNamemethod of of all child elements which have all of the given class name(s).Parameters
- classNames: string
Returns HTMLCollectionOf<Element>
getElementsByName
The
getElementsByName()method of the Document object returns a NodeList Collection of elements with a givennameattribute in the document.Parameters
- elementName: string
Returns NodeListOf<HTMLElement>
getElementsByTagName
- getElementsByTagName<K extends keyof HTMLElementTagNameMap>(
qualifiedName: K,
): HTMLCollectionOf<HTMLElementTagNameMap[K]>The
getElementsByTagNamemethod of The complete document is searched, including the root node.Type Parameters
- K extends keyof HTMLElementTagNameMap
Parameters
- qualifiedName: K
Returns HTMLCollectionOf<HTMLElementTagNameMap[K]>
- getElementsByTagName<K extends keyof SVGElementTagNameMap>(
qualifiedName: K,
): HTMLCollectionOf<SVGElementTagNameMap[K]>Type Parameters
- K extends keyof SVGElementTagNameMap
Parameters
- qualifiedName: K
Returns HTMLCollectionOf<SVGElementTagNameMap[K]>
- getElementsByTagName<K extends keyof MathMLElementTagNameMap>(
qualifiedName: K,
): HTMLCollectionOf<MathMLElementTagNameMap[K]>Type Parameters
- K extends keyof MathMLElementTagNameMap
Parameters
- qualifiedName: K
Returns HTMLCollectionOf<MathMLElementTagNameMap[K]>
- getElementsByTagName<K extends keyof HTMLElementDeprecatedTagNameMap>(
qualifiedName: K,
): HTMLCollectionOf<HTMLElementDeprecatedTagNameMap[K]>Type Parameters
- K extends keyof HTMLElementDeprecatedTagNameMap
Parameters
- qualifiedName: K
Returns HTMLCollectionOf<HTMLElementDeprecatedTagNameMap[K]>
Parameters
- qualifiedName: string
Returns HTMLCollectionOf<Element>
getElementsByTagNameNS
- getElementsByTagNameNS(
namespaceURI: "http://www.w3.org/1999/xhtml",
localName: string,
): HTMLCollectionOf<HTMLElement>Returns a list of elements with the given tag name belonging to the given namespace.
Parameters
- namespaceURI: "http://www.w3.org/1999/xhtml"
- localName: string
Returns HTMLCollectionOf<HTMLElement>
- getElementsByTagNameNS(
namespaceURI: "http://www.w3.org/2000/svg",
localName: string,
): HTMLCollectionOf<SVGElement>Parameters
- namespaceURI: "http://www.w3.org/2000/svg"
- localName: string
Returns HTMLCollectionOf<SVGElement>
- getElementsByTagNameNS(
namespaceURI: "http://www.w3.org/1998/Math/MathML",
localName: string,
): HTMLCollectionOf<MathMLElement>Parameters
- namespaceURI: "http://www.w3.org/1998/Math/MathML"
- localName: string
Returns HTMLCollectionOf<MathMLElement>
Parameters
- namespace: string | null
- localName: string
Returns HTMLCollectionOf<Element>
getRootNode
The
getRootNode()method of the Node interface returns the context object's root, which optionally includes the shadow root if it is available.Parameters
Optionaloptions: GetRootNodeOptions
Returns Node
getSelection
The
getSelection()method of the Document interface returns the Selection object associated with this document, representing the range of text selected by the user, or the current position of the caret.Returns Selection | null
hasChildNodes
The
hasChildNodes()method of the Node interface returns a boolean value indicating whether the given Node has child nodes or not.Returns boolean
hasFocus
The
hasFocus()method of the Document interface returns a boolean value indicating whether the document or any element inside the document has focus.Returns boolean
hasStorageAccess
The
hasStorageAccess()method of the Document interface returns a Promise that resolves with a boolean value indicating whether the document has access to third-party, unpartitioned cookies.Returns Promise<boolean>
importNode
The Document object's
importNode()method creates a copy of a inserted into the current document later.Type Parameters
- T extends Node
Parameters
- node: T
Optionaloptions: boolean | ImportNodeOptions
Returns T
insertBefore
isDefaultNamespace
The
isDefaultNamespace()method of the Node interface accepts a namespace URI as an argument.Parameters
- namespace: string | null
Returns boolean
isEqualNode
The
isEqualNode()method of the Node interface tests whether two nodes are equal.Parameters
- otherNode: Node | null
Returns boolean
isSameNode
The
isSameNode()method of the Node interface is a legacy alias the for the===strict equality operator.Parameters
- otherNode: Node | null
Returns boolean
lookupNamespaceURI
The
lookupNamespaceURI()method of the Node interface takes a prefix as parameter and returns the namespace URI associated with it on the given node if found (andnullif not).Parameters
- prefix: string | null
Returns string | null
lookupPrefix
The
lookupPrefix()method of the Node interface returns a string containing the prefix for a given namespace URI, if present, andnullif not.Parameters
- namespace: string | null
Returns string | null
normalize
The
normalize()method of the Node interface puts the specified node and all of its sub-tree into a normalized form.Returns void
open
prepend
Inserts nodes before the first child of node, while replacing strings in nodes with equivalent Text nodes.
Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated.
Parameters
- ...nodes: (string | Node)[]
Returns void
queryCommandEnabled
queryCommandIndeterm
queryCommandState
queryCommandSupported
queryCommandValue
querySelector
- querySelector<K extends keyof HTMLElementTagNameMap>(
selectors: K,
): HTMLElementTagNameMap[K] | nullReturns the first element that is a descendant of node that matches selectors.
Type Parameters
- K extends keyof HTMLElementTagNameMap
Parameters
- selectors: K
Returns HTMLElementTagNameMap[K] | null
Type Parameters
- K extends keyof SVGElementTagNameMap
Parameters
- selectors: K
Returns SVGElementTagNameMap[K] | null
- querySelector<K extends keyof MathMLElementTagNameMap>(
selectors: K,
): MathMLElementTagNameMap[K] | nullType Parameters
- K extends keyof MathMLElementTagNameMap
Parameters
- selectors: K
Returns MathMLElementTagNameMap[K] | null
- querySelector<K extends keyof HTMLElementDeprecatedTagNameMap>(
selectors: K,
): HTMLElementDeprecatedTagNameMap[K] | nullType Parameters
- K extends keyof HTMLElementDeprecatedTagNameMap
Parameters
- selectors: K
Returns HTMLElementDeprecatedTagNameMap[K] | null
querySelectorAll
- querySelectorAll<K extends keyof HTMLElementTagNameMap>(
selectors: K,
): NodeListOf<HTMLElementTagNameMap[K]>Returns all element descendants of node that match selectors.
Type Parameters
- K extends keyof HTMLElementTagNameMap
Parameters
- selectors: K
Returns NodeListOf<HTMLElementTagNameMap[K]>
- querySelectorAll<K extends keyof SVGElementTagNameMap>(
selectors: K,
): NodeListOf<SVGElementTagNameMap[K]>Type Parameters
- K extends keyof SVGElementTagNameMap
Parameters
- selectors: K
Returns NodeListOf<SVGElementTagNameMap[K]>
- querySelectorAll<K extends keyof MathMLElementTagNameMap>(
selectors: K,
): NodeListOf<MathMLElementTagNameMap[K]>Type Parameters
- K extends keyof MathMLElementTagNameMap
Parameters
- selectors: K
Returns NodeListOf<MathMLElementTagNameMap[K]>
- querySelectorAll<K extends keyof HTMLElementDeprecatedTagNameMap>(
selectors: K,
): NodeListOf<HTMLElementDeprecatedTagNameMap[K]>Type Parameters
- K extends keyof HTMLElementDeprecatedTagNameMap
Parameters
- selectors: K
Returns NodeListOf<HTMLElementDeprecatedTagNameMap[K]>
releaseEvents
removeChild
removeEventListener
- removeEventListener<K extends keyof DocumentEventMap>(
type: K,
listener: (this: XMLDocument, ev: DocumentEventMap[K]) => any,
options?: boolean | EventListenerOptions,
): voidThe
removeEventListener()method of the EventTarget interface removes an event listener previously registered with EventTarget.addEventListener() from the target.Type Parameters
- K extends keyof DocumentEventMap
Parameters
- type: K
- listener: (this: XMLDocument, ev: DocumentEventMap[K]) => any
Optionaloptions: boolean | EventListenerOptions
Returns void
- removeEventListener(
type: string,
listener: EventListenerOrEventListenerObject,
options?: boolean | EventListenerOptions,
): voidThe
removeEventListener()method of the EventTarget interface removes an event listener previously registered with EventTarget.addEventListener() from the target.Parameters
- type: string
- listener: EventListenerOrEventListenerObject
Optionaloptions: boolean | EventListenerOptions
Returns void
replaceChild
replaceChildren
Replace all children of node with nodes, while replacing strings in nodes with equivalent Text nodes.
Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated.
Parameters
- ...nodes: (string | Node)[]
Returns void
requestStorageAccess
The
requestStorageAccess()method of the Document interface allows content loaded in a third-party context (i.e., embedded in an iframe) to request access to third-party cookies and unpartitioned state.Returns Promise<void>
startViewTransition
- startViewTransition(
callbackOptions?:
| ViewTransitionUpdateCallback
| StartViewTransitionOptions,
): ViewTransitionThe
startViewTransition()method of the Document interface starts a new same-document (SPA) view transition and returns a ViewTransition object to represent it.Parameters
OptionalcallbackOptions: ViewTransitionUpdateCallback | StartViewTransitionOptions
Returns ViewTransition
write
writeln
The
writeln()method of the Document interface writes text in one or more TrustedHTML or string parameters to a document stream opened by document.open(), followed by a newline character.Parameters
- ...text: string[]
Returns void
The XMLDocument interface represents an XML document.
MDN Reference