Interface Document

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

    MDN Reference

    interface Document {
        activeElement: Element;
        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;
        defaultView: Window & typeof globalThis;
        designMode: string;
        dir: string;
        doctype: DocumentType;
        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;
        firstElementChild: Element;
        fonts: FontFaceSet;
        forms: HTMLCollectionOf<HTMLFormElement>;
        fullscreen: boolean;
        fullscreenElement: Element;
        fullscreenEnabled: boolean;
        head: HTMLHeadElement;
        hidden: boolean;
        images: HTMLCollectionOf<HTMLImageElement>;
        implementation: DOMImplementation;
        inputEncoding: string;
        isConnected: boolean;
        lastChild: ChildNode;
        lastElementChild: Element;
        lastModified: string;
        linkColor: string;
        links: HTMLCollectionOf<HTMLAnchorElement | HTMLAreaElement>;
        nextSibling: ChildNode;
        nodeName: string;
        nodeType: number;
        nodeValue: string;
        NOTATION_NODE: 12;
        onabort: ((this: GlobalEventHandlers, ev: UIEvent) => any);
        onanimationcancel: ((this: GlobalEventHandlers, ev: AnimationEvent) => any);
        onanimationend: ((this: GlobalEventHandlers, ev: AnimationEvent) => any);
        onanimationiteration: ((this: GlobalEventHandlers, ev: AnimationEvent) => any);
        onanimationstart: ((this: GlobalEventHandlers, ev: AnimationEvent) => any);
        onauxclick: ((this: GlobalEventHandlers, ev: MouseEvent) => any);
        onbeforeinput: ((this: GlobalEventHandlers, ev: InputEvent) => any);
        onbeforetoggle: ((this: GlobalEventHandlers, ev: Event) => any);
        onbeforexrselect: ((this: GlobalEventHandlers, ev: XRSessionEvent) => any);
        onblur: ((this: GlobalEventHandlers, ev: FocusEvent) => any);
        oncancel: ((this: GlobalEventHandlers, ev: Event) => any);
        oncanplay: ((this: GlobalEventHandlers, ev: Event) => any);
        oncanplaythrough: ((this: GlobalEventHandlers, ev: Event) => any);
        onchange: ((this: GlobalEventHandlers, ev: Event) => any);
        onclick: ((this: GlobalEventHandlers, ev: MouseEvent) => any);
        onclose: ((this: GlobalEventHandlers, ev: Event) => any);
        oncontextlost: ((this: GlobalEventHandlers, ev: Event) => any);
        oncontextmenu: ((this: GlobalEventHandlers, ev: MouseEvent) => any);
        oncontextrestored: ((this: GlobalEventHandlers, ev: Event) => any);
        oncopy: ((this: GlobalEventHandlers, ev: ClipboardEvent) => any);
        oncuechange: ((this: GlobalEventHandlers, ev: Event) => any);
        oncut: ((this: GlobalEventHandlers, ev: ClipboardEvent) => any);
        ondblclick: ((this: GlobalEventHandlers, ev: MouseEvent) => any);
        ondrag: ((this: GlobalEventHandlers, ev: DragEvent) => any);
        ondragend: ((this: GlobalEventHandlers, ev: DragEvent) => any);
        ondragenter: ((this: GlobalEventHandlers, ev: DragEvent) => any);
        ondragleave: ((this: GlobalEventHandlers, ev: DragEvent) => any);
        ondragover: ((this: GlobalEventHandlers, ev: DragEvent) => any);
        ondragstart: ((this: GlobalEventHandlers, ev: DragEvent) => any);
        ondrop: ((this: GlobalEventHandlers, ev: DragEvent) => any);
        ondurationchange: ((this: GlobalEventHandlers, ev: Event) => any);
        onemptied: ((this: GlobalEventHandlers, ev: Event) => any);
        onended: ((this: GlobalEventHandlers, ev: Event) => any);
        onerror: OnErrorEventHandlerNonNull;
        onfocus: ((this: GlobalEventHandlers, ev: FocusEvent) => any);
        onformdata: ((this: GlobalEventHandlers, ev: FormDataEvent) => any);
        onfullscreenchange: ((this: Document, ev: Event) => any);
        onfullscreenerror: ((this: Document, ev: Event) => any);
        ongotpointercapture: ((this: GlobalEventHandlers, ev: PointerEvent) => any);
        oninput: ((this: GlobalEventHandlers, ev: Event) => any);
        oninvalid: ((this: GlobalEventHandlers, ev: Event) => any);
        onkeydown: ((this: GlobalEventHandlers, ev: KeyboardEvent) => any);
        onkeypress: ((this: GlobalEventHandlers, ev: KeyboardEvent) => any);
        onkeyup: ((this: GlobalEventHandlers, ev: KeyboardEvent) => any);
        onload: ((this: GlobalEventHandlers, ev: Event) => any);
        onloadeddata: ((this: GlobalEventHandlers, ev: Event) => any);
        onloadedmetadata: ((this: GlobalEventHandlers, ev: Event) => any);
        onloadstart: ((this: GlobalEventHandlers, ev: Event) => any);
        onlostpointercapture: ((this: GlobalEventHandlers, ev: PointerEvent) => any);
        onmousedown: ((this: GlobalEventHandlers, ev: MouseEvent) => any);
        onmouseenter: ((this: GlobalEventHandlers, ev: MouseEvent) => any);
        onmouseleave: ((this: GlobalEventHandlers, ev: MouseEvent) => any);
        onmousemove: ((this: GlobalEventHandlers, ev: MouseEvent) => any);
        onmouseout: ((this: GlobalEventHandlers, ev: MouseEvent) => any);
        onmouseover: ((this: GlobalEventHandlers, ev: MouseEvent) => any);
        onmouseup: ((this: GlobalEventHandlers, ev: MouseEvent) => any);
        onpaste: ((this: GlobalEventHandlers, ev: ClipboardEvent) => any);
        onpause: ((this: GlobalEventHandlers, ev: Event) => any);
        onplay: ((this: GlobalEventHandlers, ev: Event) => any);
        onplaying: ((this: GlobalEventHandlers, ev: Event) => any);
        onpointercancel: ((this: GlobalEventHandlers, ev: PointerEvent) => any);
        onpointerdown: ((this: GlobalEventHandlers, ev: PointerEvent) => any);
        onpointerenter: ((this: GlobalEventHandlers, ev: PointerEvent) => any);
        onpointerleave: ((this: GlobalEventHandlers, ev: PointerEvent) => any);
        onpointerlockchange: ((this: Document, ev: Event) => any);
        onpointerlockerror: ((this: Document, ev: Event) => any);
        onpointermove: ((this: GlobalEventHandlers, ev: PointerEvent) => any);
        onpointerout: ((this: GlobalEventHandlers, ev: PointerEvent) => any);
        onpointerover: ((this: GlobalEventHandlers, ev: PointerEvent) => any);
        onpointerup: ((this: GlobalEventHandlers, ev: PointerEvent) => any);
        onprogress: ((this: GlobalEventHandlers, ev: ProgressEvent<EventTarget>) => any);
        onratechange: ((this: GlobalEventHandlers, ev: Event) => any);
        onreadystatechange: ((this: Document, ev: Event) => any);
        onreset: ((this: GlobalEventHandlers, ev: Event) => any);
        onresize: ((this: GlobalEventHandlers, ev: UIEvent) => any);
        onscroll: ((this: GlobalEventHandlers, ev: Event) => any);
        onscrollend: ((this: GlobalEventHandlers, ev: Event) => any);
        onsecuritypolicyviolation: ((this: GlobalEventHandlers, ev: SecurityPolicyViolationEvent) => any);
        onseeked: ((this: GlobalEventHandlers, ev: Event) => any);
        onseeking: ((this: GlobalEventHandlers, ev: Event) => any);
        onselect: ((this: GlobalEventHandlers, ev: Event) => any);
        onselectionchange: ((this: GlobalEventHandlers, ev: Event) => any);
        onselectstart: ((this: GlobalEventHandlers, ev: Event) => any);
        onslotchange: ((this: GlobalEventHandlers, ev: Event) => any);
        onstalled: ((this: GlobalEventHandlers, ev: Event) => any);
        onsubmit: ((this: GlobalEventHandlers, ev: SubmitEvent) => any);
        onsuspend: ((this: GlobalEventHandlers, ev: Event) => any);
        ontimeupdate: ((this: GlobalEventHandlers, ev: Event) => any);
        ontoggle: ((this: GlobalEventHandlers, ev: Event) => any);
        ontouchcancel?: ((this: GlobalEventHandlers, ev: TouchEvent) => any);
        ontouchend?: ((this: GlobalEventHandlers, ev: TouchEvent) => any);
        ontouchmove?: ((this: GlobalEventHandlers, ev: TouchEvent) => any);
        ontouchstart?: ((this: GlobalEventHandlers, ev: TouchEvent) => any);
        ontransitioncancel: ((this: GlobalEventHandlers, ev: TransitionEvent) => any);
        ontransitionend: ((this: GlobalEventHandlers, ev: TransitionEvent) => any);
        ontransitionrun: ((this: GlobalEventHandlers, ev: TransitionEvent) => any);
        ontransitionstart: ((this: GlobalEventHandlers, ev: TransitionEvent) => any);
        onvisibilitychange: ((this: Document, ev: Event) => any);
        onvolumechange: ((this: GlobalEventHandlers, ev: Event) => any);
        onwaiting: ((this: GlobalEventHandlers, ev: Event) => any);
        onwebkitanimationend: ((this: GlobalEventHandlers, ev: Event) => any);
        onwebkitanimationiteration: ((this: GlobalEventHandlers, ev: Event) => any);
        onwebkitanimationstart: ((this: GlobalEventHandlers, ev: Event) => any);
        onwebkittransitionend: ((this: GlobalEventHandlers, ev: Event) => any);
        onwheel: ((this: GlobalEventHandlers, ev: WheelEvent) => any);
        ownerDocument: null;
        parentElement: HTMLElement;
        parentNode: ParentNode;
        pictureInPictureElement: Element;
        pictureInPictureEnabled: boolean;
        plugins: HTMLCollectionOf<HTMLEmbedElement>;
        pointerLockElement: Element;
        previousSibling: ChildNode;
        PROCESSING_INSTRUCTION_NODE: 7;
        readyState: DocumentReadyState;
        referrer: string;
        rootElement: SVGSVGElement;
        scripts: HTMLCollectionOf<HTMLScriptElement>;
        scrollingElement: Element;
        styleSheets: StyleSheetList;
        TEXT_NODE: 3;
        textContent: string;
        timeline: DocumentTimeline;
        title: string;
        URL: string;
        visibilityState: DocumentVisibilityState;
        vlinkColor: string;
        location: Location;
        addEventListener<K>(type: K, listener: ((this: Document, ev: DocumentEventMap[K]) => any), options?: boolean | AddEventListenerOptions): void;
        addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;
        adoptNode<T>(node: T): T;
        append(...nodes: (string | Node)[]): void;
        appendChild<T>(node: T): T;
        captureEvents(): void;
        caretRangeFromPoint(x: number, y: number): Range;
        clear(): void;
        cloneNode(deep?: boolean): Node;
        close(): void;
        compareDocumentPosition(other: Node): number;
        contains(other: Node): boolean;
        createAttribute(localName: string): Attr;
        createAttributeNS(namespace: string, qualifiedName: string): Attr;
        createCDATASection(data: string): CDATASection;
        createComment(data: string): Comment;
        createDocumentFragment(): DocumentFragment;
        createElement<K>(tagName: K, options?: ElementCreationOptions): HTMLElementTagNameMap[K];
        createElement<K>(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>(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: K): SVGElementTagNameMap[K];
        createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: string): SVGElement;
        createElementNS<K>(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, qualifiedName: string, options?: ElementCreationOptions): Element;
        createElementNS(namespace: string, 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: "CustomEvent"): CustomEvent<any>;
        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<any>;
        createEvent(eventInterface: "MouseEvent"): MouseEvent;
        createEvent(eventInterface: "MouseEvents"): MouseEvent;
        createEvent(eventInterface: "MutationEvent"): MutationEvent;
        createEvent(eventInterface: "MutationEvents"): MutationEvent;
        createEvent(eventInterface: "OfflineAudioCompletionEvent"): OfflineAudioCompletionEvent;
        createEvent(eventInterface: "PageTransitionEvent"): PageTransitionEvent;
        createEvent(eventInterface: "PaymentMethodChangeEvent"): PaymentMethodChangeEvent;
        createEvent(eventInterface: "PaymentRequestUpdateEvent"): PaymentRequestUpdateEvent;
        createEvent(eventInterface: "PictureInPictureEvent"): PictureInPictureEvent;
        createEvent(eventInterface: "PointerEvent"): PointerEvent;
        createEvent(eventInterface: "PopStateEvent"): PopStateEvent;
        createEvent(eventInterface: "ProgressEvent"): ProgressEvent<EventTarget>;
        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): XPathExpression;
        createNodeIterator(root: Node, whatToShow?: number, filter?: NodeFilter): NodeIterator;
        createNSResolver(nodeResolver: Node): Node;
        createProcessingInstruction(target: string, data: string): ProcessingInstruction;
        createRange(): Range;
        createTextNode(data: string): Text;
        createTreeWalker(root: Node, whatToShow?: number, filter?: NodeFilter): TreeWalker;
        dispatchEvent(event: Event): boolean;
        elementFromPoint(x: number, y: number): Element;
        elementsFromPoint(x: number, y: number): Element[];
        evaluate(expression: string, contextNode: Node, resolver?: XPathNSResolver, type?: number, result?: XPathResult): XPathResult;
        execCommand(commandId: string, showUI?: boolean, value?: string): boolean;
        exitFullscreen(): Promise<void>;
        exitPictureInPicture(): Promise<void>;
        exitPointerLock(): void;
        getAnimations(): Animation[];
        getElementById(elementId: string): HTMLElement;
        getElementsByClassName(classNames: string): HTMLCollectionOf<Element>;
        getElementsByName(elementName: string): NodeListOf<HTMLElement>;
        getElementsByTagName<K>(qualifiedName: K): HTMLCollectionOf<HTMLElementTagNameMap[K]>;
        getElementsByTagName<K>(qualifiedName: K): HTMLCollectionOf<SVGElementTagNameMap[K]>;
        getElementsByTagName<K>(qualifiedName: K): HTMLCollectionOf<MathMLElementTagNameMap[K]>;
        getElementsByTagName<K>(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, localName: string): HTMLCollectionOf<Element>;
        getRootNode(options?: GetRootNodeOptions): Node;
        getSelection(): Selection;
        hasChildNodes(): boolean;
        hasFocus(): boolean;
        hasStorageAccess(): Promise<boolean>;
        importNode<T>(node: T, deep?: boolean): T;
        insertBefore<T>(node: T, child: Node): T;
        isDefaultNamespace(namespace: string): boolean;
        isEqualNode(otherNode: Node): boolean;
        isSameNode(otherNode: Node): boolean;
        lookupNamespaceURI(prefix: string): string;
        lookupPrefix(namespace: string): string;
        normalize(): void;
        open(unused1?: string, unused2?: string): Document;
        open(url: string | URL, name: string, features: string): Window;
        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>(selectors: K): HTMLElementTagNameMap[K];
        querySelector<K>(selectors: K): SVGElementTagNameMap[K];
        querySelector<K>(selectors: K): MathMLElementTagNameMap[K];
        querySelector<K>(selectors: K): HTMLElementDeprecatedTagNameMap[K];
        querySelector<E>(selectors: string): E;
        querySelectorAll<K>(selectors: K): NodeListOf<HTMLElementTagNameMap[K]>;
        querySelectorAll<K>(selectors: K): NodeListOf<SVGElementTagNameMap[K]>;
        querySelectorAll<K>(selectors: K): NodeListOf<MathMLElementTagNameMap[K]>;
        querySelectorAll<K>(selectors: K): NodeListOf<HTMLElementDeprecatedTagNameMap[K]>;
        querySelectorAll<E>(selectors: string): NodeListOf<E>;
        releaseEvents(): void;
        removeChild<T>(child: T): T;
        removeEventListener<K>(type: K, listener: ((this: Document, ev: DocumentEventMap[K]) => any), options?: boolean | EventListenerOptions): void;
        removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;
        replaceChild<T>(node: Node, child: T): T;
        replaceChildren(...nodes: (string | Node)[]): void;
        requestStorageAccess(): Promise<void>;
        startViewTransition(callbackOptions?: UpdateCallback): ViewTransition;
        write(...text: string[]): void;
        writeln(...text: string[]): void;
    }
    Hierarchy

    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 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 onbeforetoggle onbeforexrselect 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 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 textContent timeline title URL visibilityState vlinkColor

    Accessors

    Methods

    Properties

    activeElement: Element

    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

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

    MDN Reference

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

    MDN Reference

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

    MDN Reference

    Retrieves a collection of all applet objects in the document.

    MDN Reference

    ATTRIBUTE_NODE: 2
    baseURI: string

    Returns node's node document's document base URL.

    MDN Reference

    bgColor: string

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

    MDN Reference

    Specifies the beginning and end of the document body.

    MDN Reference

    CDATA_SECTION_NODE: 4

    node is a CDATASection node.

    characterSet: string

    Returns document's encoding.

    MDN Reference

    charset: string

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

    This is a legacy alias of characterSet.

    MDN Reference

    childElementCount: number
    childNodes: NodeListOf<ChildNode>

    Returns the children.

    MDN Reference

    children: HTMLCollection

    Returns the child elements.

    MDN Reference

    COMMENT_NODE: 8

    node is a Comment node.

    compatMode: string

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

    MDN Reference

    contentType: string

    Returns document's content type.

    MDN Reference

    cookie: string

    Returns the HTTP cookies that apply to the Document. If there are no cookies or cookies can't be applied to this resource, the empty string will be returned.

    Can be set, to add a new cookie to the element's set of HTTP cookies.

    If the contents are sandboxed into a unique origin (e.g. in an iframe with the sandbox attribute), a "SecurityError" DOMException will be thrown on getting and setting.

    MDN Reference

    currentScript: HTMLOrSVGScriptElement

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

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

    MDN Reference

    defaultView: Window & typeof globalThis

    Returns the Window object of the active document.

    MDN Reference

    designMode: string

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

    MDN Reference

    dir: string

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

    MDN Reference

    doctype: DocumentType

    Gets an object representing the document type declaration 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

    Gets a reference to the root node of the document.

    MDN Reference

    documentURI: string

    Returns document's URL.

    MDN Reference

    domain: string

    Sets or gets the security domain of the document.

    MDN Reference

    ELEMENT_NODE: 1

    node is an element.

    Retrieves a collection of all embed objects in the document.

    MDN Reference

    ENTITY_NODE: 6
    ENTITY_REFERENCE_NODE: 5
    fgColor: string

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

    MDN Reference

    firstChild: ChildNode

    Returns the first child.

    MDN Reference

    firstElementChild: Element

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

    MDN Reference

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

    MDN Reference

    fullscreen: boolean

    MDN Reference

    fullscreenElement: Element

    Returns document's fullscreen element.

    MDN Reference

    fullscreenEnabled: boolean

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

    MDN Reference

    Returns the head element.

    MDN Reference

    hidden: boolean

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

    MDN Reference

    implementation: DOMImplementation

    Gets the implementation object of the current document.

    MDN Reference

    inputEncoding: string

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

    This is a legacy alias of characterSet.

    MDN Reference

    isConnected: boolean

    Returns true if node is connected and false otherwise.

    MDN Reference

    lastChild: ChildNode

    Returns the last child.

    MDN Reference

    lastElementChild: Element

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

    MDN Reference

    lastModified: string

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

    MDN Reference

    linkColor: string

    Sets or gets the color of the document links.

    MDN Reference

    Retrieves a collection of all a objects that specify the href property and all area objects in the document.

    MDN Reference

    nextSibling: ChildNode

    Returns the next sibling.

    MDN Reference

    nodeName: string

    Returns a string appropriate for the type of node.

    MDN Reference

    nodeType: number

    Returns the type of node.

    MDN Reference

    nodeValue: string
    NOTATION_NODE: 12
    onabort: ((this: GlobalEventHandlers, ev: UIEvent) => any)

    Fires when the user aborts the download.

    Type declaration

    onanimationcancel: ((this: GlobalEventHandlers, ev: AnimationEvent) => any)
    onanimationend: ((this: GlobalEventHandlers, ev: AnimationEvent) => any)
    onanimationiteration: ((this: GlobalEventHandlers, ev: AnimationEvent) => any)
    onanimationstart: ((this: GlobalEventHandlers, ev: AnimationEvent) => any)
    onauxclick: ((this: GlobalEventHandlers, ev: MouseEvent) => any)
    onbeforeinput: ((this: GlobalEventHandlers, ev: InputEvent) => any)
    onbeforetoggle: ((this: GlobalEventHandlers, ev: Event) => any)
    onbeforexrselect: ((this: GlobalEventHandlers, ev: XRSessionEvent) => any)

    An XRSessionEvent of type beforexrselect is dispatched on the DOM overlay element before generating a WebXR selectstart input event if the -Z axis of the input source's targetRaySpace intersects the DOM overlay element at the time the input device's primary action is triggered.

    onblur: ((this: GlobalEventHandlers, ev: FocusEvent) => any)

    Fires when the object loses the input focus.

    Type declaration

    oncancel: ((this: GlobalEventHandlers, ev: Event) => any)
    oncanplay: ((this: GlobalEventHandlers, ev: Event) => any)

    Occurs when playback is possible, but would require further buffering.

    Type declaration

    oncanplaythrough: ((this: GlobalEventHandlers, ev: Event) => any)
    onchange: ((this: GlobalEventHandlers, ev: Event) => any)

    Fires when the contents of the object or selection have changed.

    Type declaration

    onclick: ((this: GlobalEventHandlers, ev: MouseEvent) => any)

    Fires when the user clicks the left mouse button on the object

    Type declaration

    onclose: ((this: GlobalEventHandlers, ev: Event) => any)
    oncontextlost: ((this: GlobalEventHandlers, ev: Event) => any)
    oncontextmenu: ((this: GlobalEventHandlers, ev: MouseEvent) => any)

    Fires when the user clicks the right mouse button in the client area, opening the context menu.

    Type declaration

    oncontextrestored: ((this: GlobalEventHandlers, ev: Event) => any)
    oncopy: ((this: GlobalEventHandlers, ev: ClipboardEvent) => any)
    oncuechange: ((this: GlobalEventHandlers, ev: Event) => any)
    oncut: ((this: GlobalEventHandlers, ev: ClipboardEvent) => any)
    ondblclick: ((this: GlobalEventHandlers, ev: MouseEvent) => any)

    Fires when the user double-clicks the object.

    Type declaration

    ondrag: ((this: GlobalEventHandlers, ev: DragEvent) => any)

    Fires on the source object continuously during a drag operation.

    Type declaration

    ondragend: ((this: GlobalEventHandlers, ev: DragEvent) => any)

    Fires on the source object when the user releases the mouse at the close of a drag operation.

    Type declaration

    ondragenter: ((this: GlobalEventHandlers, ev: DragEvent) => any)

    Fires on the target element when the user drags the object to a valid drop target.

    Type declaration

    ondragleave: ((this: GlobalEventHandlers, ev: DragEvent) => any)

    Fires on the target object when the user moves the mouse out of a valid drop target during a drag operation.

    Type declaration

    ondragover: ((this: GlobalEventHandlers, ev: DragEvent) => any)

    Fires on the target element continuously while the user drags the object over a valid drop target.

    Type declaration

    ondragstart: ((this: GlobalEventHandlers, ev: DragEvent) => any)

    Fires on the source object when the user starts to drag a text selection or selected object.

    Type declaration

    ondrop: ((this: GlobalEventHandlers, ev: DragEvent) => any)
    ondurationchange: ((this: GlobalEventHandlers, ev: Event) => any)

    Occurs when the duration attribute is updated.

    Type declaration

    onemptied: ((this: GlobalEventHandlers, ev: Event) => any)

    Occurs when the media element is reset to its initial state.

    Type declaration

    onended: ((this: GlobalEventHandlers, ev: Event) => any)

    Occurs when the end of playback is reached.

    Type declaration

    Fires when an error occurs during object loading.

    The event.

    MDN Reference

    onfocus: ((this: GlobalEventHandlers, ev: FocusEvent) => any)

    Fires when the object receives focus.

    Type declaration

    onformdata: ((this: GlobalEventHandlers, ev: FormDataEvent) => any)
    onfullscreenchange: ((this: Document, ev: Event) => any)
    onfullscreenerror: ((this: Document, ev: Event) => any)
    ongotpointercapture: ((this: GlobalEventHandlers, ev: PointerEvent) => any)
    oninput: ((this: GlobalEventHandlers, ev: Event) => any)
    oninvalid: ((this: GlobalEventHandlers, ev: Event) => any)
    onkeydown: ((this: GlobalEventHandlers, ev: KeyboardEvent) => any)

    Fires when the user presses a key.

    Type declaration

    onkeypress: ((this: GlobalEventHandlers, ev: KeyboardEvent) => any)

    Fires when the user presses an alphanumeric key.

    Type declaration

    MDN Reference

    onkeyup: ((this: GlobalEventHandlers, ev: KeyboardEvent) => any)

    Fires when the user releases a key.

    Type declaration

    onload: ((this: GlobalEventHandlers, ev: Event) => any)

    Fires immediately after the browser loads the object.

    Type declaration

    onloadeddata: ((this: GlobalEventHandlers, ev: Event) => any)

    Occurs when media data is loaded at the current playback position.

    Type declaration

    onloadedmetadata: ((this: GlobalEventHandlers, ev: Event) => any)

    Occurs when the duration and dimensions of the media have been determined.

    Type declaration

    onloadstart: ((this: GlobalEventHandlers, ev: Event) => any)

    Occurs when Internet Explorer begins looking for media data.

    Type declaration

    onlostpointercapture: ((this: GlobalEventHandlers, ev: PointerEvent) => any)
    onmousedown: ((this: GlobalEventHandlers, ev: MouseEvent) => any)

    Fires when the user clicks the object with either mouse button.

    Type declaration

    onmouseenter: ((this: GlobalEventHandlers, ev: MouseEvent) => any)
    onmouseleave: ((this: GlobalEventHandlers, ev: MouseEvent) => any)
    onmousemove: ((this: GlobalEventHandlers, ev: MouseEvent) => any)

    Fires when the user moves the mouse over the object.

    Type declaration

    onmouseout: ((this: GlobalEventHandlers, ev: MouseEvent) => any)

    Fires when the user moves the mouse pointer outside the boundaries of the object.

    Type declaration

    onmouseover: ((this: GlobalEventHandlers, ev: MouseEvent) => any)

    Fires when the user moves the mouse pointer into the object.

    Type declaration

    onmouseup: ((this: GlobalEventHandlers, ev: MouseEvent) => any)

    Fires when the user releases a mouse button while the mouse is over the object.

    Type declaration

    onpaste: ((this: GlobalEventHandlers, ev: ClipboardEvent) => any)
    onpause: ((this: GlobalEventHandlers, ev: Event) => any)

    Occurs when playback is paused.

    Type declaration

    onplay: ((this: GlobalEventHandlers, ev: Event) => any)

    Occurs when the play method is requested.

    Type declaration

    onplaying: ((this: GlobalEventHandlers, ev: Event) => any)

    Occurs when the audio or video has started playing.

    Type declaration

    onpointercancel: ((this: GlobalEventHandlers, ev: PointerEvent) => any)
    onpointerdown: ((this: GlobalEventHandlers, ev: PointerEvent) => any)
    onpointerenter: ((this: GlobalEventHandlers, ev: PointerEvent) => any)
    onpointerleave: ((this: GlobalEventHandlers, ev: PointerEvent) => any)
    onpointerlockchange: ((this: Document, ev: Event) => any)
    onpointerlockerror: ((this: Document, ev: Event) => any)
    onpointermove: ((this: GlobalEventHandlers, ev: PointerEvent) => any)
    onpointerout: ((this: GlobalEventHandlers, ev: PointerEvent) => any)
    onpointerover: ((this: GlobalEventHandlers, ev: PointerEvent) => any)
    onpointerup: ((this: GlobalEventHandlers, ev: PointerEvent) => any)
    onprogress: ((this: GlobalEventHandlers, ev: ProgressEvent<EventTarget>) => any)

    Occurs to indicate progress while downloading media data.

    Type declaration

    onratechange: ((this: GlobalEventHandlers, ev: Event) => any)

    Occurs when the playback rate is increased or decreased.

    Type declaration

    onreadystatechange: ((this: Document, ev: Event) => any)

    Fires when the state of the object has changed.

    Type declaration

    onreset: ((this: GlobalEventHandlers, ev: Event) => any)

    Fires when the user resets a form.

    Type declaration

    onresize: ((this: GlobalEventHandlers, ev: UIEvent) => any)
    onscroll: ((this: GlobalEventHandlers, ev: Event) => any)

    Fires when the user repositions the scroll box in the scroll bar on the object.

    Type declaration

    onscrollend: ((this: GlobalEventHandlers, ev: Event) => any)
    onsecuritypolicyviolation: ((this: GlobalEventHandlers, ev: SecurityPolicyViolationEvent) => any)
    onseeked: ((this: GlobalEventHandlers, ev: Event) => any)

    Occurs when the seek operation ends.

    Type declaration

    onseeking: ((this: GlobalEventHandlers, ev: Event) => any)

    Occurs when the current playback position is moved.

    Type declaration

    onselect: ((this: GlobalEventHandlers, ev: Event) => any)

    Fires when the current selection changes.

    Type declaration

    onselectionchange: ((this: GlobalEventHandlers, ev: Event) => any)
    onselectstart: ((this: GlobalEventHandlers, ev: Event) => any)
    onslotchange: ((this: GlobalEventHandlers, ev: Event) => any)
    onstalled: ((this: GlobalEventHandlers, ev: Event) => any)

    Occurs when the download has stopped.

    Type declaration

    onsubmit: ((this: GlobalEventHandlers, ev: SubmitEvent) => any)
    onsuspend: ((this: GlobalEventHandlers, ev: Event) => any)

    Occurs if the load operation has been intentionally halted.

    Type declaration

    ontimeupdate: ((this: GlobalEventHandlers, ev: Event) => any)

    Occurs to indicate the current playback position.

    Type declaration

    ontoggle: ((this: GlobalEventHandlers, ev: Event) => any)
    ontouchcancel?: ((this: GlobalEventHandlers, ev: TouchEvent) => any)
    ontouchend?: ((this: GlobalEventHandlers, ev: TouchEvent) => any)
    ontouchmove?: ((this: GlobalEventHandlers, ev: TouchEvent) => any)
    ontouchstart?: ((this: GlobalEventHandlers, ev: TouchEvent) => any)
    ontransitioncancel: ((this: GlobalEventHandlers, ev: TransitionEvent) => any)
    ontransitionend: ((this: GlobalEventHandlers, ev: TransitionEvent) => any)
    ontransitionrun: ((this: GlobalEventHandlers, ev: TransitionEvent) => any)
    ontransitionstart: ((this: GlobalEventHandlers, ev: TransitionEvent) => any)
    onvisibilitychange: ((this: Document, ev: Event) => any)
    onvolumechange: ((this: GlobalEventHandlers, ev: Event) => any)

    Occurs when the volume is changed, or playback is muted or unmuted.

    Type declaration

    onwaiting: ((this: GlobalEventHandlers, ev: Event) => any)

    Occurs when playback stops because the next frame of a video resource is not available.

    Type declaration

    onwebkitanimationend: ((this: GlobalEventHandlers, ev: Event) => any)

    This is a legacy alias of onanimationend.

    MDN Reference

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

    This is a legacy alias of onanimationiteration.

    MDN Reference

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

    This is a legacy alias of onanimationstart.

    MDN Reference

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

    This is a legacy alias of ontransitionend.

    MDN Reference

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

    Returns the node document. Returns null for documents.

    MDN Reference

    parentElement: HTMLElement

    Returns the parent element.

    MDN Reference

    parentNode: ParentNode

    Returns the parent.

    MDN Reference

    pictureInPictureElement: Element
    pictureInPictureEnabled: boolean

    Return an HTMLCollection of the embed elements in the Document.

    MDN Reference

    pointerLockElement: Element
    previousSibling: ChildNode

    Returns the previous sibling.

    MDN Reference

    PROCESSING_INSTRUCTION_NODE: 7

    node is a ProcessingInstruction node.

    readyState: DocumentReadyState

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

    MDN Reference

    referrer: string

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

    MDN Reference

    rootElement: SVGSVGElement

    MDN Reference

    Retrieves a collection of all script objects in the document.

    MDN Reference

    scrollingElement: Element
    styleSheets: StyleSheetList

    Retrieves a collection of styleSheet objects representing the style sheets that correspond to each instance of a link or style object in the document.

    MDN Reference

    TEXT_NODE: 3

    node is a Text node.

    textContent: string
    title: string

    Contains the title of the document.

    MDN Reference

    URL: string

    Sets or gets the URL for the current document.

    MDN Reference

    visibilityState: DocumentVisibilityState
    vlinkColor: string

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

    MDN Reference

    Accessors

    Methods

    • Appends an event listener for events whose type attribute value is type. The callback argument sets the callback that will be invoked when the event is dispatched.

      The options argument sets listener-specific options. For compatibility this can be a boolean, in which case the method behaves exactly as if the value was specified as options's capture.

      When set to true, options's capture prevents callback from being invoked when the event's eventPhase attribute value is BUBBLING_PHASE. When false (or not present), callback will not be invoked when event's eventPhase attribute value is CAPTURING_PHASE. Either way, callback will be invoked if event's eventPhase attribute value is AT_TARGET.

      When set to true, options's passive indicates that the callback will not cancel the event by invoking preventDefault(). This is used to enable performance optimizations described in § 2.8 Observing event listeners.

      When set to true, options's once indicates that the callback will only be invoked once after which the event listener will be removed.

      If an AbortSignal is passed for options's signal, then the event listener will be removed when signal is aborted.

      The event listener is appended to target's event listener list and is not appended if it has the same type, callback, and capture.

      MDN Reference

      Type Parameters

      Parameters

      Returns void

    • Appends an event listener for events whose type attribute value is type. The callback argument sets the callback that will be invoked when the event is dispatched.

      The options argument sets listener-specific options. For compatibility this can be a boolean, in which case the method behaves exactly as if the value was specified as options's capture.

      When set to true, options's capture prevents callback from being invoked when the event's eventPhase attribute value is BUBBLING_PHASE. When false (or not present), callback will not be invoked when event's eventPhase attribute value is CAPTURING_PHASE. Either way, callback will be invoked if event's eventPhase attribute value is AT_TARGET.

      When set to true, options's passive indicates that the callback will not cancel the event by invoking preventDefault(). This is used to enable performance optimizations described in § 2.8 Observing event listeners.

      When set to true, options's once indicates that the callback will only be invoked once after which the event listener will be removed.

      If an AbortSignal is passed for options's signal, then the event listener will be removed when signal is aborted.

      The event listener is appended to target's event listener list and is not appended if it has the same type, callback, and capture.

      MDN Reference

      Parameters

      Returns void

    • Moves node from another document and returns it.

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

      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

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

      Returns void

    • Returns void

    • Parameters

      • x: number
      • y: number

      Returns Range

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

      MDN Reference

      Parameters

      • Optionaldeep: boolean

      Returns Node

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

      MDN Reference

      Returns void

    • Returns true if other is an inclusive descendant of node, and false otherwise.

      MDN Reference

      Parameters

      Returns boolean

    • Creates an attribute object with a specified name.

      Parameters

      • localName: string

      Returns Attr

    • Parameters

      • namespace: string
      • qualifiedName: string

      Returns Attr

    • Creates a comment object with the specified data.

      Parameters

      Returns Comment

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

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

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

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

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

      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 a NodeIterator object that you can use to traverse filtered lists of nodes or elements in a document.

      Parameters

      • root: Node

        The root element or node to start traversing on.

      • OptionalwhatToShow: number

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

      • Optionalfilter: NodeFilter

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

        MDN Reference

      Returns NodeIterator

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

      MDN Reference

      Parameters

      • target: string
      • data: string

      Returns ProcessingInstruction

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

      MDN Reference

      Returns Range

    • Creates a text string from the specified value.

      Parameters

      • data: string

        String that specifies the nodeValue property of the text node.

        MDN Reference

      Returns Text

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

      Parameters

      • root: Node

        The root element or node to start traversing on.

      • OptionalwhatToShow: number

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

      • Optionalfilter: NodeFilter

        A custom NodeFilter function to use.

        MDN Reference

      Returns TreeWalker

    • Dispatches a synthetic event event to target and returns true if either event's cancelable attribute value is false or its preventDefault() method was not invoked, and false otherwise.

      MDN Reference

      Parameters

      Returns boolean

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

      Parameters

      • commandId: string

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

      • OptionalshowUI: boolean

        Display the user interface, defaults to false.

      • Optionalvalue: string

        Value to assign.

      Returns boolean

      MDN Reference

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

      MDN Reference

      Returns Promise<void>

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

      MDN Reference

      Parameters

      • classNames: string

      Returns HTMLCollectionOf<Element>

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

      Parameters

      • elementName: string

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

        MDN Reference

      Returns NodeListOf<HTMLElement>

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

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

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

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

      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
      • localName: string

      Returns HTMLCollectionOf<Element>

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

      MDN Reference

      Returns Selection

    • Gets a value indicating whether the object currently has focus.

      MDN Reference

      Returns boolean

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

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

      MDN Reference

      Type Parameters

      Parameters

      • node: T
      • Optionaldeep: boolean

      Returns T

    • Removes empty exclusive Text nodes and concatenates the data of remaining contiguous exclusive Text nodes into the first of their nodes.

      MDN Reference

      Returns void

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

      Parameters

      • Optionalunused1: string
      • Optionalunused2: string

      Returns Document

    • Parameters

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

      Returns Window

    • 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

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

      Returns void

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

      Parameters

      • commandId: string

        Specifies a command identifier.

      Returns boolean

      MDN Reference

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

      Parameters

      • commandId: string

        String that specifies a command identifier.

      Returns boolean

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

      Parameters

      • commandId: string

        String that specifies a command identifier.

      Returns boolean

      MDN Reference

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

      Parameters

      • commandId: string

        Specifies a command identifier.

      Returns boolean

      MDN Reference

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

      Parameters

      • commandId: string

        String that specifies a command identifier.

      Returns string

    • Returns void

    • 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

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

      Returns void

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

      Parameters

      • Rest...text: string[]

      Returns void

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

      Parameters

      • Rest...text: string[]

      Returns void