The Document interface represents any web page loaded in the browser and serves as an entry point into the web page's content, which is the DOM tree.

MDN Reference

interface Document {
    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: Document, 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: Document, 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
Index

Properties

activeElement adoptedStyleSheets alinkColor all anchors applets ATTRIBUTE_NODE baseURI bgColor body CDATA_SECTION_NODE characterSet charset childElementCount childNodes children COMMENT_NODE compatMode contentType cookie currentScript defaultView designMode dir doctype DOCUMENT_FRAGMENT_NODE DOCUMENT_NODE DOCUMENT_POSITION_CONTAINED_BY DOCUMENT_POSITION_CONTAINS DOCUMENT_POSITION_DISCONNECTED DOCUMENT_POSITION_FOLLOWING DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC DOCUMENT_POSITION_PRECEDING DOCUMENT_TYPE_NODE documentElement documentURI domain ELEMENT_NODE embeds ENTITY_NODE ENTITY_REFERENCE_NODE fgColor firstChild firstElementChild fonts forms fragmentDirective fullscreen fullscreenElement fullscreenEnabled head hidden images implementation inputEncoding isConnected lastChild lastElementChild lastModified linkColor links nextSibling nodeName nodeType nodeValue NOTATION_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 onpointerup onprogress onratechange onreadystatechange onreset onresize onscroll onscrollend onsecuritypolicyviolation onseeked onseeking onselect onselectionchange onselectstart onslotchange onstalled onsubmit onsuspend ontimeupdate ontoggle ontouchcancel? ontouchend? ontouchmove? ontouchstart? ontransitioncancel ontransitionend ontransitionrun ontransitionstart onvisibilitychange onvolumechange onwaiting onwebkitanimationend onwebkitanimationiteration onwebkitanimationstart onwebkittransitionend onwheel ownerDocument parentElement parentNode pictureInPictureElement pictureInPictureEnabled plugins pointerLockElement previousSibling PROCESSING_INSTRUCTION_NODE readyState referrer rootElement scripts scrollingElement styleSheets TEXT_NODE timeline title URL visibilityState vlinkColor

Accessors

Methods

Properties

activeElement: Element | null

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.

MDN Reference

adoptedStyleSheets: CSSStyleSheet[]
alinkColor: string

Returns or sets the color of an active link in the document body.

MDN Reference

all: HTMLAllCollection

The Document interface's read-only all property returns an HTMLAllCollection rooted at the document node.

MDN Reference

anchors: HTMLCollectionOf<HTMLAnchorElement>

The anchors read-only property of the An HTMLCollection.

MDN Reference

The applets property of the Document returns an empty HTMLCollection.

MDN Reference

ATTRIBUTE_NODE: 2
baseURI: string

The read-only baseURI property of the Node interface returns the absolute base URL of the document containing the node.

MDN Reference

bgColor: string

The deprecated bgColor property gets or sets the background color of the current document.

MDN Reference

The Document.body property represents the null if no such element exists.

MDN Reference

CDATA_SECTION_NODE: 4

node is a CDATASection node.

characterSet: string

The Document.characterSet read-only property returns the character encoding of the document that it's currently rendered with.

MDN Reference

charset: string

This is a legacy alias of characterSet.

MDN Reference

childElementCount: number
childNodes: NodeListOf<ChildNode>

The read-only childNodes property of the Node interface returns a live the first child node is assigned index 0.

MDN Reference

children: HTMLCollection

Returns the child elements.

MDN Reference

COMMENT_NODE: 8

node is a Comment node.

compatMode: string

The Document.compatMode read-only property indicates whether the document is rendered in Quirks mode or Standards mode.

MDN Reference

contentType: string

The Document.contentType read-only property returns the MIME type that the document is being rendered as.

MDN Reference

cookie: string

The Document property cookie lets you read and write cookies associated with the document.

MDN Reference

currentScript: HTMLOrSVGScriptElement | null

The Document.currentScript property returns the script element whose script is currently being processed and isn't a JavaScript module.

MDN Reference

defaultView: Window & typeof globalThis | null

In browsers, document.defaultView returns the This property is read-only.

MDN Reference

designMode: string

document.designMode controls whether the entire document is editable.

MDN Reference

dir: string

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.

MDN Reference

doctype: DocumentType | null

The doctype read-only property of the Document interface is a DocumentType object representing the Doctype associated with the current document.

MDN Reference

DOCUMENT_FRAGMENT_NODE: 11

node is a DocumentFragment node.

DOCUMENT_NODE: 9

node is a document.

DOCUMENT_POSITION_CONTAINED_BY: 16

Set when other is a descendant of node.

DOCUMENT_POSITION_CONTAINS: 8

Set when other is an ancestor of node.

DOCUMENT_POSITION_DISCONNECTED: 1

Set when node and other are not in the same tree.

DOCUMENT_POSITION_FOLLOWING: 4

Set when other is following node.

DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: 32
DOCUMENT_POSITION_PRECEDING: 2

Set when other is preceding node.

DOCUMENT_TYPE_NODE: 10

node is a doctype.

documentElement: HTMLElement

The documentElement read-only property of the Document interface returns the example, the html element for HTML documents).

MDN Reference

documentURI: string

The documentURI read-only property of the A string.

MDN Reference

domain: string

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.

MDN Reference

ELEMENT_NODE: 1

node is an element.

embeds: HTMLCollectionOf<HTMLEmbedElement>

The embeds read-only property of the An HTMLCollection.

MDN Reference

ENTITY_NODE: 6
ENTITY_REFERENCE_NODE: 5
fgColor: string

fgColor gets/sets the foreground color, or text color, of the current document.

MDN Reference

firstChild: ChildNode | null

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.

MDN Reference

firstElementChild: Element | null

Returns the first child that is an element, and null otherwise.

MDN Reference

fonts: FontFaceSet
forms: HTMLCollectionOf<HTMLFormElement>

The forms read-only property of the Document interface returns an HTMLCollection listing all the form elements contained in the document.

MDN Reference

fragmentDirective: FragmentDirective

The fragmentDirective read-only property of the Document interface returns the FragmentDirective for the current document.

MDN Reference

fullscreen: boolean

The obsolete Document interface's fullscreen read-only property reports whether or not the document is currently displaying content in fullscreen mode.

MDN Reference

fullscreenElement: Element | null

Returns document's fullscreen element.

MDN Reference

fullscreenEnabled: boolean

The read-only fullscreenEnabled property on the Document interface indicates whether or not fullscreen mode is available.

MDN Reference

The head read-only property of the Document interface returns the head element of the current document.

MDN Reference

hidden: boolean

The Document.hidden read-only property returns a Boolean value indicating if the page is considered hidden or not.

MDN Reference

images: HTMLCollectionOf<HTMLImageElement>

The images read-only property of the Document interface returns a collection of the images in the current HTML document.

MDN Reference

implementation: DOMImplementation

The Document.implementation property returns a A DOMImplementation object.

MDN Reference

inputEncoding: string

This is a legacy alias of characterSet.

MDN Reference

isConnected: boolean

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.

MDN Reference

lastChild: ChildNode | null

The read-only lastChild property of the Node interface returns the last child of the node, or null if there are no child nodes.

MDN Reference

lastElementChild: Element | null

Returns the last child that is an element, and null otherwise.

MDN Reference

lastModified: string

The lastModified property of the Document interface returns a string containing the date and local time on which the current document was last modified.

MDN Reference

linkColor: string

The Document.linkColor property gets/sets the color of links within the document.

MDN Reference

links: HTMLCollectionOf<HTMLAnchorElement | HTMLAreaElement>

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.

MDN Reference

nextSibling: ChildNode | null

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.

MDN Reference

nodeName: string

The read-only nodeName property of Node returns the name of the current node as a string.

MDN Reference

nodeType: number

The read-only nodeType property of a Node interface is an integer that identifies what the node is.

MDN Reference

nodeValue: string | null

The nodeValue property of the Node interface returns or sets the value of the current node.

MDN Reference

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
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

MDN Reference

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

Available only in secure contexts.

MDN Reference

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

This is a legacy alias of onanimationend.

MDN Reference

onwebkitanimationiteration:
    | ((this: GlobalEventHandlers, ev: Event) => any)
    | null

This is a legacy alias of onanimationiteration.

MDN Reference

onwebkitanimationstart: ((this: GlobalEventHandlers, ev: Event) => any) | null

This is a legacy alias of onanimationstart.

MDN Reference

onwebkittransitionend: ((this: GlobalEventHandlers, ev: Event) => any) | null

This is a legacy alias of ontransitionend.

MDN Reference

onwheel: ((this: GlobalEventHandlers, ev: WheelEvent) => any) | null
ownerDocument: null

The read-only ownerDocument property of the Node interface returns the top-level document object of the node.

MDN Reference

parentElement: HTMLElement | null

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.

MDN Reference

parentNode: ParentNode | null

The read-only parentNode property of the Node interface returns the parent of the specified node in the DOM tree.

MDN Reference

pictureInPictureElement: Element | null
pictureInPictureEnabled: boolean

The read-only pictureInPictureEnabled property of the available.

MDN Reference

plugins: HTMLCollectionOf<HTMLEmbedElement>

The plugins read-only property of the containing one or more HTMLEmbedElements representing the An HTMLCollection.

MDN Reference

pointerLockElement: Element | null
previousSibling: ChildNode | null

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.

MDN Reference

PROCESSING_INSTRUCTION_NODE: 7

node is a ProcessingInstruction node.

readyState: DocumentReadyState

The Document.readyState property describes the loading state of the document.

MDN Reference

referrer: string

The Document.referrer property returns the URI of the page that linked to this page.

MDN Reference

rootElement: SVGSVGElement | null

Document.rootElement returns the Element that is the root element of the document if it is an documents.

MDN Reference

scripts: HTMLCollectionOf<HTMLScriptElement>

The scripts property of the Document interface returns a list of the script elements in the document.

MDN Reference

scrollingElement: Element | null

The scrollingElement read-only property of the scrolls the document.

MDN Reference

styleSheets: StyleSheetList
TEXT_NODE: 3

node is a Text node.

The timeline readonly property of the Document interface represents the default timeline of the current document.

MDN Reference

title: string

The document.title property gets or sets the current title of the document.

MDN Reference

URL: string

The URL read-only property of the Document interface returns the document location as a string.

MDN Reference

visibilityState: DocumentVisibilityState

The Document.visibilityState read-only property returns the visibility of the document.

MDN Reference

vlinkColor: string

The Document.vlinkColor property gets/sets the color of links that the user has visited in the document.

MDN Reference

Accessors

  • get location(): Location

    The Document.location read-only property returns a and provides methods for changing that URL and loading another URL.

    MDN Reference

    Returns Location

  • set location(href: string): void

    Parameters

    • href: string

    Returns void

Methods

  • Document.adoptNode() transfers a node/dom from another Document into the method's document.

    MDN Reference

    Type Parameters

    Parameters

    • node: T

    Returns T

  • 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.

    MDN Reference

    Parameters

    • ...nodes: (string | Node)[]

    Returns void

  • The appendChild() method of the Node interface adds a node to the end of the list of children of a specified parent node.

    MDN Reference

    Type Parameters

    Parameters

    • node: T

    Returns T

  • Returns void

  • The 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.

    MDN Reference

    Parameters

    Returns CaretPosition | null

  • Parameters

    • x: number
    • y: number

    Returns Range | null

  • The Document.clear() method does nothing, but doesn't raise any error.

    Returns void

    MDN Reference

  • The cloneNode() method of the Node interface returns a duplicate of the node on which this method was called.

    MDN Reference

    Parameters

    • Optionalsubtree: boolean

    Returns Node

  • The Document.close() method finishes writing to a document, opened with Document.open().

    MDN Reference

    Returns void

  • The compareDocumentPosition() method of the Node interface reports the position of its argument node relative to the node on which it is called.

    MDN Reference

    Parameters

    Returns number

  • 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.

    MDN Reference

    Parameters

    Returns boolean

  • The Document.createAttribute() method creates a new attribute node, and returns it.

    MDN Reference

    Parameters

    • localName: string

    Returns Attr

  • The Document.createAttributeNS() method creates a new attribute node with the specified namespace URI and qualified name, and returns it.

    MDN Reference

    Parameters

    • namespace: string | null
    • qualifiedName: string

    Returns Attr

  • createCDATASection() creates a new CDATA section node, and returns it.

    MDN Reference

    Parameters

    • data: string

    Returns CDATASection

  • createComment() creates a new comment node, and returns it.

    MDN Reference

    Parameters

    • data: string

    Returns Comment

  • Creates a new empty DocumentFragment into which DOM nodes can be added to build an offscreen DOM tree.

    MDN Reference

    Returns DocumentFragment

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

    MDN Reference

    Parameters

    • namespaceURI: "http://www.w3.org/1999/xhtml"
    • qualifiedName: string

    Returns HTMLElement

  • Type Parameters

    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

  • Type Parameters

    Parameters

    • namespaceURI: "http://www.w3.org/1998/Math/MathML"
    • qualifiedName: K

    Returns MathMLElementTagNameMap[K]

  • Parameters

    • namespaceURI: "http://www.w3.org/1998/Math/MathML"
    • qualifiedName: string

    Returns MathMLElement

  • Parameters

    Returns Element

  • Parameters

    Returns Element

  • Creates an event of the type specified.

    Parameters

    • eventInterface: "AnimationEvent"

    Returns AnimationEvent

    MDN Reference

  • 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

  • Parameters

    • 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

  • The Document.createNodeIterator() method returns a new NodeIterator object.

    MDN Reference

    Parameters

    Returns NodeIterator

  • createProcessingInstruction() generates a new processing instruction node and returns it.

    MDN Reference

    Parameters

    • target: string
    • data: string

    Returns ProcessingInstruction

  • The Document.createRange() method returns a new js-nolint createRange() None.

    MDN Reference

    Returns Range

  • Creates a new Text node.

    MDN Reference

    Parameters

    • data: string

    Returns Text

  • The Document.createTreeWalker() creator method returns a newly created TreeWalker object.

    MDN Reference

    Parameters

    Returns TreeWalker

  • The dispatchEvent() method of the EventTarget sends an Event to the object, (synchronously) invoking the affected event listeners in the appropriate order.

    MDN Reference

    Parameters

    • event: Event

    Returns boolean

  • The execCommand method implements multiple different commands.

    Parameters

    • commandId: string
    • OptionalshowUI: boolean
    • Optionalvalue: string

    Returns boolean

    MDN Reference

  • 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.

    MDN Reference

    Returns Promise<void>

  • 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.

    MDN Reference

    Returns Promise<void>

  • The exitPointerLock() method of the Document interface asynchronously releases a pointer lock previously requested through Element.requestPointerLock.

    MDN Reference

    Returns void

  • The getElementsByClassName method of of all child elements which have all of the given class name(s).

    MDN Reference

    Parameters

    • classNames: string

    Returns HTMLCollectionOf<Element>

  • The getElementsByName() method of the Document object returns a NodeList Collection of elements with a given name attribute in the document.

    MDN Reference

    Parameters

    • elementName: string

    Returns NodeListOf<HTMLElement>

  • Returns a list of elements with the given tag name belonging to the given namespace.

    MDN Reference

    Parameters

    • namespaceURI: "http://www.w3.org/1999/xhtml"
    • localName: string

    Returns HTMLCollectionOf<HTMLElement>

  • Parameters

    • namespaceURI: "http://www.w3.org/2000/svg"
    • localName: string

    Returns HTMLCollectionOf<SVGElement>

  • Parameters

    • namespaceURI: "http://www.w3.org/1998/Math/MathML"
    • localName: string

    Returns HTMLCollectionOf<MathMLElement>

  • Parameters

    • namespace: string | null
    • localName: string

    Returns HTMLCollectionOf<Element>

  • 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.

    MDN Reference

    Returns Selection | null

  • The hasChildNodes() method of the Node interface returns a boolean value indicating whether the given Node has child nodes or not.

    MDN Reference

    Returns boolean

  • The hasFocus() method of the Document interface returns a boolean value indicating whether the document or any element inside the document has focus.

    MDN Reference

    Returns boolean

  • 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.

    MDN Reference

    Returns Promise<boolean>

  • The Document object's importNode() method creates a copy of a inserted into the current document later.

    MDN Reference

    Type Parameters

    Parameters

    Returns T

  • The insertBefore() method of the Node interface inserts a node before a reference node as a child of a specified parent node.

    MDN Reference

    Type Parameters

    Parameters

    • node: T
    • child: Node | null

    Returns T

  • The isDefaultNamespace() method of the Node interface accepts a namespace URI as an argument.

    MDN Reference

    Parameters

    • namespace: string | null

    Returns boolean

  • The isEqualNode() method of the Node interface tests whether two nodes are equal.

    MDN Reference

    Parameters

    • otherNode: Node | null

    Returns boolean

  • The isSameNode() method of the Node interface is a legacy alias the for the === strict equality operator.

    MDN Reference

    Parameters

    • otherNode: Node | null

    Returns boolean

  • 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 (and null if not).

    MDN Reference

    Parameters

    • prefix: string | null

    Returns string | null

  • The lookupPrefix() method of the Node interface returns a string containing the prefix for a given namespace URI, if present, and null if not.

    MDN Reference

    Parameters

    • namespace: string | null

    Returns string | null

  • The normalize() method of the Node interface puts the specified node and all of its sub-tree into a normalized form.

    MDN Reference

    Returns void

  • The Document.open() method opens a document for This does come with some side effects.

    MDN Reference

    Parameters

    • Optionalunused1: string
    • Optionalunused2: string

    Returns Document

  • Parameters

    • url: string | URL
    • name: string
    • features: string

    Returns Window | null

  • 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.

    MDN Reference

    Parameters

    • ...nodes: (string | Node)[]

    Returns void

  • The Document.queryCommandEnabled() method reports whether or not the specified editor command is enabled by the browser.

    Parameters

    • commandId: string

    Returns boolean

    MDN Reference

  • Parameters

    • commandId: string

    Returns boolean

  • The queryCommandState() method will tell you if the current selection has a certain Document.execCommand() command applied.

    Parameters

    • commandId: string

    Returns boolean

    MDN Reference

  • The Document.queryCommandSupported() method reports whether or not the specified editor command is supported by the browser.

    Parameters

    • commandId: string

    Returns boolean

    MDN Reference

  • Parameters

    • commandId: string

    Returns string

  • Returns void

  • The removeChild() method of the Node interface removes a child node from the DOM and returns the removed node.

    MDN Reference

    Type Parameters

    Parameters

    • child: T

    Returns T

  • The removeEventListener() method of the EventTarget interface removes an event listener previously registered with EventTarget.addEventListener() from the target.

    MDN Reference

    Type Parameters

    Parameters

    Returns void

  • The removeEventListener() method of the EventTarget interface removes an event listener previously registered with EventTarget.addEventListener() from the target.

    MDN Reference

    Parameters

    Returns void

  • The replaceChild() method of the Node interface replaces a child node within the given (parent) node.

    MDN Reference

    Type Parameters

    Parameters

    Returns T

  • 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.

    MDN Reference

    Parameters

    • ...nodes: (string | Node)[]

    Returns void

  • 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.

    MDN Reference

    Returns Promise<void>

  • The write() method of the Document interface writes text in one or more TrustedHTML or string parameters to a document stream opened by document.open().

    Parameters

    • ...text: string[]

    Returns void

    MDN Reference

  • 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.

    MDN Reference

    Parameters

    • ...text: string[]

    Returns void