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 {
    ATTRIBUTE_NODE: 2;
    CDATA_SECTION_NODE: 4;
    COMMENT_NODE: 8;
    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;
    ELEMENT_NODE: 1;
    ENTITY_NODE: 6;
    ENTITY_REFERENCE_NODE: 5;
    NOTATION_NODE: 12;
    PROCESSING_INSTRUCTION_NODE: 7;
    TEXT_NODE: 3;
    URL: string;
    activeElement: null | Element;
    adoptedStyleSheets: CSSStyleSheet[];
    alinkColor: string;
    all: HTMLAllCollection;
    anchors: HTMLCollectionOf<HTMLAnchorElement>;
    applets: HTMLCollection;
    baseURI: string;
    bgColor: string;
    body: HTMLElement;
    characterSet: string;
    charset: string;
    childElementCount: number;
    childNodes: NodeListOf<ChildNode>;
    children: HTMLCollection;
    compatMode: string;
    contentType: string;
    cookie: string;
    currentScript: null | HTMLOrSVGScriptElement;
    defaultView: null | Window & typeof globalThis;
    designMode: string;
    dir: string;
    doctype: null | DocumentType;
    documentElement: HTMLElement;
    documentURI: string;
    domain: string;
    embeds: HTMLCollectionOf<HTMLEmbedElement>;
    fgColor: string;
    firstChild: null | ChildNode;
    firstElementChild: null | Element;
    fonts: FontFaceSet;
    forms: HTMLCollectionOf<HTMLFormElement>;
    fullscreen: boolean;
    fullscreenElement: null | Element;
    fullscreenEnabled: boolean;
    head: HTMLHeadElement;
    hidden: boolean;
    images: HTMLCollectionOf<HTMLImageElement>;
    implementation: DOMImplementation;
    inputEncoding: string;
    isConnected: boolean;
    lastChild: null | ChildNode;
    lastElementChild: null | Element;
    lastModified: string;
    linkColor: string;
    links: HTMLCollectionOf<HTMLAnchorElement | HTMLAreaElement>;
    nextSibling: null | ChildNode;
    nodeName: string;
    nodeType: number;
    nodeValue: null | string;
    onabort: null | ((this, ev) => any);
    onanimationcancel: null | ((this, ev) => any);
    onanimationend: null | ((this, ev) => any);
    onanimationiteration: null | ((this, ev) => any);
    onanimationstart: null | ((this, ev) => any);
    onauxclick: null | ((this, ev) => any);
    onbeforeinput: null | ((this, ev) => any);
    onblur: null | ((this, ev) => any);
    oncancel: null | ((this, ev) => any);
    oncanplay: null | ((this, ev) => any);
    oncanplaythrough: null | ((this, ev) => any);
    onchange: null | ((this, ev) => any);
    onclick: null | ((this, ev) => any);
    onclose: null | ((this, ev) => any);
    oncontextmenu: null | ((this, ev) => any);
    oncopy: null | ((this, ev) => any);
    oncuechange: null | ((this, ev) => any);
    oncut: null | ((this, ev) => any);
    ondblclick: null | ((this, ev) => any);
    ondrag: null | ((this, ev) => any);
    ondragend: null | ((this, ev) => any);
    ondragenter: null | ((this, ev) => any);
    ondragleave: null | ((this, ev) => any);
    ondragover: null | ((this, ev) => any);
    ondragstart: null | ((this, ev) => any);
    ondrop: null | ((this, ev) => any);
    ondurationchange: null | ((this, ev) => any);
    onemptied: null | ((this, ev) => any);
    onended: null | ((this, ev) => any);
    onerror: OnErrorEventHandler;
    onfocus: null | ((this, ev) => any);
    onformdata: null | ((this, ev) => any);
    onfullscreenchange: null | ((this, ev) => any);
    onfullscreenerror: null | ((this, ev) => any);
    ongotpointercapture: null | ((this, ev) => any);
    oninput: null | ((this, ev) => any);
    oninvalid: null | ((this, ev) => any);
    onkeydown: null | ((this, ev) => any);
    onkeypress: null | ((this, ev) => any);
    onkeyup: null | ((this, ev) => any);
    onload: null | ((this, ev) => any);
    onloadeddata: null | ((this, ev) => any);
    onloadedmetadata: null | ((this, ev) => any);
    onloadstart: null | ((this, ev) => any);
    onlostpointercapture: null | ((this, ev) => any);
    onmousedown: null | ((this, ev) => any);
    onmouseenter: null | ((this, ev) => any);
    onmouseleave: null | ((this, ev) => any);
    onmousemove: null | ((this, ev) => any);
    onmouseout: null | ((this, ev) => any);
    onmouseover: null | ((this, ev) => any);
    onmouseup: null | ((this, ev) => any);
    onpaste: null | ((this, ev) => any);
    onpause: null | ((this, ev) => any);
    onplay: null | ((this, ev) => any);
    onplaying: null | ((this, ev) => any);
    onpointercancel: null | ((this, ev) => any);
    onpointerdown: null | ((this, ev) => any);
    onpointerenter: null | ((this, ev) => any);
    onpointerleave: null | ((this, ev) => any);
    onpointerlockchange: null | ((this, ev) => any);
    onpointerlockerror: null | ((this, ev) => any);
    onpointermove: null | ((this, ev) => any);
    onpointerout: null | ((this, ev) => any);
    onpointerover: null | ((this, ev) => any);
    onpointerup: null | ((this, ev) => any);
    onprogress: null | ((this, ev) => any);
    onratechange: null | ((this, ev) => any);
    onreadystatechange: null | ((this, ev) => any);
    onreset: null | ((this, ev) => any);
    onresize: null | ((this, ev) => any);
    onscroll: null | ((this, ev) => any);
    onscrollend: null | ((this, ev) => any);
    onsecuritypolicyviolation: null | ((this, ev) => any);
    onseeked: null | ((this, ev) => any);
    onseeking: null | ((this, ev) => any);
    onselect: null | ((this, ev) => any);
    onselectionchange: null | ((this, ev) => any);
    onselectstart: null | ((this, ev) => any);
    onslotchange: null | ((this, ev) => any);
    onstalled: null | ((this, ev) => any);
    onsubmit: null | ((this, ev) => any);
    onsuspend: null | ((this, ev) => any);
    ontimeupdate: null | ((this, ev) => any);
    ontoggle: null | ((this, ev) => any);
    ontouchcancel?: null | ((this, ev) => any);
    ontouchend?: null | ((this, ev) => any);
    ontouchmove?: null | ((this, ev) => any);
    ontouchstart?: null | ((this, ev) => any);
    ontransitioncancel: null | ((this, ev) => any);
    ontransitionend: null | ((this, ev) => any);
    ontransitionrun: null | ((this, ev) => any);
    ontransitionstart: null | ((this, ev) => any);
    onvisibilitychange: null | ((this, ev) => any);
    onvolumechange: null | ((this, ev) => any);
    onwaiting: null | ((this, ev) => any);
    onwebkitanimationend: null | ((this, ev) => any);
    onwebkitanimationiteration: null | ((this, ev) => any);
    onwebkitanimationstart: null | ((this, ev) => any);
    onwebkittransitionend: null | ((this, ev) => any);
    onwheel: null | ((this, ev) => any);
    ownerDocument: null;
    parentElement: null | HTMLElement;
    parentNode: null | ParentNode;
    pictureInPictureElement: null | Element;
    pictureInPictureEnabled: boolean;
    plugins: HTMLCollectionOf<HTMLEmbedElement>;
    pointerLockElement: null | Element;
    previousSibling: null | ChildNode;
    readyState: DocumentReadyState;
    referrer: string;
    rootElement: null | SVGSVGElement;
    scripts: HTMLCollectionOf<HTMLScriptElement>;
    scrollingElement: null | Element;
    styleSheets: StyleSheetList;
    textContent: null | string;
    timeline: DocumentTimeline;
    title: string;
    visibilityState: DocumentVisibilityState;
    vlinkColor: string;
    location: Location;
    addEventListener<K>(type, listener, options?): void;
    addEventListener(type, listener, options?): void;
    adoptNode<T>(node): T;
    append(...nodes): void;
    appendChild<T>(node): T;
    captureEvents(): void;
    caretRangeFromPoint(x, y): null | Range;
    clear(): void;
    cloneNode(deep?): Node;
    close(): void;
    compareDocumentPosition(other): number;
    contains(other): boolean;
    createAttribute(localName): Attr;
    createAttributeNS(namespace, qualifiedName): Attr;
    createCDATASection(data): CDATASection;
    createComment(data): Comment;
    createDocumentFragment(): DocumentFragment;
    createElement<K>(tagName, options?): HTMLElementTagNameMap[K];
    createElement<K>(tagName, options?): HTMLElementDeprecatedTagNameMap[K];
    createElement(tagName, options?): HTMLElement;
    createElementNS(namespaceURI, qualifiedName): HTMLElement;
    createElementNS<K>(namespaceURI, qualifiedName): SVGElementTagNameMap[K];
    createElementNS(namespaceURI, qualifiedName): SVGElement;
    createElementNS<K>(namespaceURI, qualifiedName): MathMLElementTagNameMap[K];
    createElementNS(namespaceURI, qualifiedName): MathMLElement;
    createElementNS(namespaceURI, qualifiedName, options?): Element;
    createElementNS(namespace, qualifiedName, options?): Element;
    createEvent(eventInterface): AnimationEvent;
    createEvent(eventInterface): AnimationPlaybackEvent;
    createEvent(eventInterface): AudioProcessingEvent;
    createEvent(eventInterface): BeforeUnloadEvent;
    createEvent(eventInterface): BlobEvent;
    createEvent(eventInterface): ClipboardEvent;
    createEvent(eventInterface): CloseEvent;
    createEvent(eventInterface): CompositionEvent;
    createEvent(eventInterface): CustomEvent<any>;
    createEvent(eventInterface): DeviceMotionEvent;
    createEvent(eventInterface): DeviceOrientationEvent;
    createEvent(eventInterface): DragEvent;
    createEvent(eventInterface): ErrorEvent;
    createEvent(eventInterface): Event;
    createEvent(eventInterface): Event;
    createEvent(eventInterface): FocusEvent;
    createEvent(eventInterface): FontFaceSetLoadEvent;
    createEvent(eventInterface): FormDataEvent;
    createEvent(eventInterface): GamepadEvent;
    createEvent(eventInterface): HashChangeEvent;
    createEvent(eventInterface): IDBVersionChangeEvent;
    createEvent(eventInterface): InputEvent;
    createEvent(eventInterface): KeyboardEvent;
    createEvent(eventInterface): MIDIConnectionEvent;
    createEvent(eventInterface): MIDIMessageEvent;
    createEvent(eventInterface): MediaEncryptedEvent;
    createEvent(eventInterface): MediaKeyMessageEvent;
    createEvent(eventInterface): MediaQueryListEvent;
    createEvent(eventInterface): MediaStreamTrackEvent;
    createEvent(eventInterface): MessageEvent<any>;
    createEvent(eventInterface): MouseEvent;
    createEvent(eventInterface): MouseEvent;
    createEvent(eventInterface): MutationEvent;
    createEvent(eventInterface): MutationEvent;
    createEvent(eventInterface): OfflineAudioCompletionEvent;
    createEvent(eventInterface): PageTransitionEvent;
    createEvent(eventInterface): PaymentMethodChangeEvent;
    createEvent(eventInterface): PaymentRequestUpdateEvent;
    createEvent(eventInterface): PictureInPictureEvent;
    createEvent(eventInterface): PointerEvent;
    createEvent(eventInterface): PopStateEvent;
    createEvent(eventInterface): ProgressEvent<EventTarget>;
    createEvent(eventInterface): PromiseRejectionEvent;
    createEvent(eventInterface): RTCDTMFToneChangeEvent;
    createEvent(eventInterface): RTCDataChannelEvent;
    createEvent(eventInterface): RTCErrorEvent;
    createEvent(eventInterface): RTCPeerConnectionIceErrorEvent;
    createEvent(eventInterface): RTCPeerConnectionIceEvent;
    createEvent(eventInterface): RTCTrackEvent;
    createEvent(eventInterface): SecurityPolicyViolationEvent;
    createEvent(eventInterface): SpeechSynthesisErrorEvent;
    createEvent(eventInterface): SpeechSynthesisEvent;
    createEvent(eventInterface): StorageEvent;
    createEvent(eventInterface): SubmitEvent;
    createEvent(eventInterface): ToggleEvent;
    createEvent(eventInterface): TouchEvent;
    createEvent(eventInterface): TrackEvent;
    createEvent(eventInterface): TransitionEvent;
    createEvent(eventInterface): UIEvent;
    createEvent(eventInterface): UIEvent;
    createEvent(eventInterface): WebGLContextEvent;
    createEvent(eventInterface): WheelEvent;
    createEvent(eventInterface): Event;
    createExpression(expression, resolver?): XPathExpression;
    createNSResolver(nodeResolver): Node;
    createNodeIterator(root, whatToShow?, filter?): NodeIterator;
    createProcessingInstruction(target, data): ProcessingInstruction;
    createRange(): Range;
    createTextNode(data): Text;
    createTreeWalker(root, whatToShow?, filter?): TreeWalker;
    dispatchEvent(event): boolean;
    elementFromPoint(x, y): null | Element;
    elementsFromPoint(x, y): Element[];
    evaluate(expression, contextNode, resolver?, type?, result?): XPathResult;
    execCommand(commandId, showUI?, value?): boolean;
    exitFullscreen(): Promise<void>;
    exitPictureInPicture(): Promise<void>;
    exitPointerLock(): void;
    getAnimations(): Animation[];
    getElementById(elementId): null | HTMLElement;
    getElementsByClassName(classNames): HTMLCollectionOf<Element>;
    getElementsByName(elementName): NodeListOf<HTMLElement>;
    getElementsByTagName<K>(qualifiedName): HTMLCollectionOf<HTMLElementTagNameMap[K]>;
    getElementsByTagName<K>(qualifiedName): HTMLCollectionOf<SVGElementTagNameMap[K]>;
    getElementsByTagName<K>(qualifiedName): HTMLCollectionOf<MathMLElementTagNameMap[K]>;
    getElementsByTagName<K>(qualifiedName): HTMLCollectionOf<HTMLElementDeprecatedTagNameMap[K]>;
    getElementsByTagName(qualifiedName): HTMLCollectionOf<Element>;
    getElementsByTagNameNS(namespaceURI, localName): HTMLCollectionOf<HTMLElement>;
    getElementsByTagNameNS(namespaceURI, localName): HTMLCollectionOf<SVGElement>;
    getElementsByTagNameNS(namespaceURI, localName): HTMLCollectionOf<MathMLElement>;
    getElementsByTagNameNS(namespace, localName): HTMLCollectionOf<Element>;
    getRootNode(options?): Node;
    getSelection(): null | Selection;
    hasChildNodes(): boolean;
    hasFocus(): boolean;
    hasStorageAccess(): Promise<boolean>;
    importNode<T>(node, deep?): T;
    insertBefore<T>(node, child): T;
    isDefaultNamespace(namespace): boolean;
    isEqualNode(otherNode): boolean;
    isSameNode(otherNode): boolean;
    lookupNamespaceURI(prefix): null | string;
    lookupPrefix(namespace): null | string;
    normalize(): void;
    open(unused1?, unused2?): Document;
    open(url, name, features): null | Window;
    prepend(...nodes): void;
    queryCommandEnabled(commandId): boolean;
    queryCommandIndeterm(commandId): boolean;
    queryCommandState(commandId): boolean;
    queryCommandSupported(commandId): boolean;
    queryCommandValue(commandId): string;
    querySelector<K>(selectors): null | HTMLElementTagNameMap[K];
    querySelector<K>(selectors): null | SVGElementTagNameMap[K];
    querySelector<K>(selectors): null | MathMLElementTagNameMap[K];
    querySelector<K>(selectors): null | HTMLElementDeprecatedTagNameMap[K];
    querySelector<E>(selectors): null | E;
    querySelectorAll<K>(selectors): NodeListOf<HTMLElementTagNameMap[K]>;
    querySelectorAll<K>(selectors): NodeListOf<SVGElementTagNameMap[K]>;
    querySelectorAll<K>(selectors): NodeListOf<MathMLElementTagNameMap[K]>;
    querySelectorAll<K>(selectors): NodeListOf<HTMLElementDeprecatedTagNameMap[K]>;
    querySelectorAll<E>(selectors): NodeListOf<E>;
    releaseEvents(): void;
    removeChild<T>(child): T;
    removeEventListener<K>(type, listener, options?): void;
    removeEventListener(type, listener, options?): void;
    replaceChild<T>(node, child): T;
    replaceChildren(...nodes): void;
    requestStorageAccess(): Promise<void>;
    startViewTransition(updateCallback): ViewTransition;
    write(...text): void;
    writeln(...text): void;
}

Hierarchy

  • Node
  • DocumentOrShadowRoot
  • FontFaceSource
  • GlobalEventHandlers
  • NonElementParentNode
  • ParentNode
  • XPathEvaluatorBase
    • Document

Properties

ATTRIBUTE_NODE CDATA_SECTION_NODE COMMENT_NODE 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 ELEMENT_NODE ENTITY_NODE ENTITY_REFERENCE_NODE NOTATION_NODE PROCESSING_INSTRUCTION_NODE TEXT_NODE URL activeElement adoptedStyleSheets alinkColor all anchors applets baseURI bgColor body characterSet charset childElementCount childNodes children compatMode contentType cookie currentScript defaultView designMode dir doctype documentElement documentURI domain embeds fgColor firstChild firstElementChild fonts forms fullscreen fullscreenElement fullscreenEnabled head hidden images implementation inputEncoding isConnected lastChild lastElementChild lastModified linkColor links nextSibling nodeName nodeType nodeValue onabort onanimationcancel onanimationend onanimationiteration onanimationstart onauxclick onbeforeinput onblur oncancel oncanplay oncanplaythrough onchange onclick onclose oncontextmenu 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 readyState referrer rootElement scripts scrollingElement styleSheets textContent timeline title visibilityState vlinkColor

Accessors

Methods

Properties

ATTRIBUTE_NODE: 2
CDATA_SECTION_NODE: 4

node is a CDATASection node.

COMMENT_NODE: 8

node is a Comment node.

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.

ELEMENT_NODE: 1

node is an element.

ENTITY_NODE: 6
ENTITY_REFERENCE_NODE: 5
NOTATION_NODE: 12
PROCESSING_INSTRUCTION_NODE: 7

node is a ProcessingInstruction node.

TEXT_NODE: 3

node is a Text node.

URL: string

Sets or gets the URL for the current document.

MDN Reference

activeElement: null | 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.

Deprecated

MDN Reference

all: HTMLAllCollection

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

Deprecated

MDN Reference

anchors: HTMLCollectionOf<HTMLAnchorElement>

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

Deprecated

MDN Reference

applets: HTMLCollection

Retrieves a collection of all applet objects in the document.

Deprecated

MDN Reference

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.

Deprecated

MDN Reference

body: HTMLElement

Specifies the beginning and end of the document body.

MDN Reference

characterSet: string

Returns document's encoding.

MDN Reference

charset: string

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

Deprecated

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

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: null | 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: null | 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: null | DocumentType

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

MDN Reference

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.

Deprecated

MDN Reference

embeds: HTMLCollectionOf<HTMLEmbedElement>

Retrieves a collection of all embed objects in the document.

MDN Reference

fgColor: string

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

Deprecated

MDN Reference

firstChild: null | ChildNode

Returns the first child.

MDN Reference

firstElementChild: null | Element

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

MDN Reference

fonts: FontFaceSet
forms: HTMLCollectionOf<HTMLFormElement>

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

MDN Reference

fullscreen: boolean

Deprecated

MDN Reference

fullscreenElement: null | 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

head: HTMLHeadElement

Returns the head element.

MDN Reference

hidden: boolean
images: HTMLCollectionOf<HTMLImageElement>

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.

Deprecated

This is a legacy alias of characterSet.

MDN Reference

isConnected: boolean

Returns true if node is connected and false otherwise.

MDN Reference

lastChild: null | ChildNode

Returns the last child.

MDN Reference

lastElementChild: null | 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.

Deprecated

MDN Reference

links: HTMLCollectionOf<HTMLAnchorElement | HTMLAreaElement>

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

MDN Reference

nextSibling: null | 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: null | string
onabort: null | ((this, ev) => any)

Fires when the user aborts the download.

Type declaration

    • (this, ev): any
    • Parameters

      • this: GlobalEventHandlers
      • ev: UIEvent

      Returns any

Param: ev

The event.

MDN Reference

onanimationcancel: null | ((this, ev) => any)

Type declaration

    • (this, ev): any
    • Parameters

      • this: GlobalEventHandlers
      • ev: AnimationEvent

      Returns any

onanimationend: null | ((this, ev) => any)

Type declaration

    • (this, ev): any
    • Parameters

      • this: GlobalEventHandlers
      • ev: AnimationEvent

      Returns any

onanimationiteration: null | ((this, ev) => any)

Type declaration

    • (this, ev): any
    • Parameters

      • this: GlobalEventHandlers
      • ev: AnimationEvent

      Returns any

onanimationstart: null | ((this, ev) => any)

Type declaration

    • (this, ev): any
    • Parameters

      • this: GlobalEventHandlers
      • ev: AnimationEvent

      Returns any

onauxclick: null | ((this, ev) => any)

Type declaration

    • (this, ev): any
    • Parameters

      • this: GlobalEventHandlers
      • ev: MouseEvent

      Returns any

onbeforeinput: null | ((this, ev) => any)

Type declaration

    • (this, ev): any
    • Parameters

      • this: GlobalEventHandlers
      • ev: InputEvent

      Returns any

onblur: null | ((this, ev) => any)

Fires when the object loses the input focus.

Type declaration

    • (this, ev): any
    • Parameters

      • this: GlobalEventHandlers
      • ev: FocusEvent

      Returns any

Param: ev

The focus event.

MDN Reference

oncancel: null | ((this, ev) => any)

Type declaration

    • (this, ev): any
    • Parameters

      • this: GlobalEventHandlers
      • ev: Event

      Returns any

oncanplay: null | ((this, ev) => any)

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

Type declaration

    • (this, ev): any
    • Parameters

      • this: GlobalEventHandlers
      • ev: Event

      Returns any

Param: ev

The event.

MDN Reference

oncanplaythrough: null | ((this, ev) => any)

Type declaration

    • (this, ev): any
    • Parameters

      • this: GlobalEventHandlers
      • ev: Event

      Returns any

onchange: null | ((this, ev) => any)

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

Type declaration

    • (this, ev): any
    • Parameters

      • this: GlobalEventHandlers
      • ev: Event

      Returns any

Param: ev

The event.

MDN Reference

onclick: null | ((this, ev) => any)

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

Type declaration

    • (this, ev): any
    • Parameters

      • this: GlobalEventHandlers
      • ev: MouseEvent

      Returns any

Param: ev

The mouse event.

MDN Reference

onclose: null | ((this, ev) => any)

Type declaration

    • (this, ev): any
    • Parameters

      • this: GlobalEventHandlers
      • ev: Event

      Returns any

oncontextmenu: null | ((this, ev) => any)

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

Type declaration

    • (this, ev): any
    • Parameters

      • this: GlobalEventHandlers
      • ev: MouseEvent

      Returns any

Param: ev

The mouse event.

MDN Reference

oncopy: null | ((this, ev) => any)

Type declaration

    • (this, ev): any
    • Parameters

      • this: GlobalEventHandlers
      • ev: ClipboardEvent

      Returns any

oncuechange: null | ((this, ev) => any)

Type declaration

    • (this, ev): any
    • Parameters

      • this: GlobalEventHandlers
      • ev: Event

      Returns any

oncut: null | ((this, ev) => any)

Type declaration

    • (this, ev): any
    • Parameters

      • this: GlobalEventHandlers
      • ev: ClipboardEvent

      Returns any

ondblclick: null | ((this, ev) => any)

Fires when the user double-clicks the object.

Type declaration

    • (this, ev): any
    • Parameters

      • this: GlobalEventHandlers
      • ev: MouseEvent

      Returns any

Param: ev

The mouse event.

MDN Reference

ondrag: null | ((this, ev) => any)

Fires on the source object continuously during a drag operation.

Type declaration

    • (this, ev): any
    • Parameters

      • this: GlobalEventHandlers
      • ev: DragEvent

      Returns any

Param: ev

The event.

MDN Reference

ondragend: null | ((this, ev) => any)

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

Type declaration

    • (this, ev): any
    • Parameters

      • this: GlobalEventHandlers
      • ev: DragEvent

      Returns any

Param: ev

The event.

MDN Reference

ondragenter: null | ((this, ev) => any)

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

Type declaration

    • (this, ev): any
    • Parameters

      • this: GlobalEventHandlers
      • ev: DragEvent

      Returns any

Param: ev

The drag event.

MDN Reference

ondragleave: null | ((this, ev) => any)

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

Type declaration

    • (this, ev): any
    • Parameters

      • this: GlobalEventHandlers
      • ev: DragEvent

      Returns any

Param: ev

The drag event.

MDN Reference

ondragover: null | ((this, ev) => any)

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

Type declaration

    • (this, ev): any
    • Parameters

      • this: GlobalEventHandlers
      • ev: DragEvent

      Returns any

Param: ev

The event.

MDN Reference

ondragstart: null | ((this, ev) => any)

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

Type declaration

    • (this, ev): any
    • Parameters

      • this: GlobalEventHandlers
      • ev: DragEvent

      Returns any

Param: ev

The event.

MDN Reference

ondrop: null | ((this, ev) => any)

Type declaration

    • (this, ev): any
    • Parameters

      • this: GlobalEventHandlers
      • ev: DragEvent

      Returns any

ondurationchange: null | ((this, ev) => any)

Occurs when the duration attribute is updated.

Type declaration

    • (this, ev): any
    • Parameters

      • this: GlobalEventHandlers
      • ev: Event

      Returns any

Param: ev

The event.

MDN Reference

onemptied: null | ((this, ev) => any)

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

Type declaration

    • (this, ev): any
    • Parameters

      • this: GlobalEventHandlers
      • ev: Event

      Returns any

Param: ev

The event.

MDN Reference

onended: null | ((this, ev) => any)

Occurs when the end of playback is reached.

Type declaration

    • (this, ev): any
    • Parameters

      • this: GlobalEventHandlers
      • ev: Event

      Returns any

Param: ev

The event

MDN Reference

onerror: OnErrorEventHandler

Fires when an error occurs during object loading.

Param: ev

The event.

MDN Reference

onfocus: null | ((this, ev) => any)

Fires when the object receives focus.

Type declaration

    • (this, ev): any
    • Parameters

      • this: GlobalEventHandlers
      • ev: FocusEvent

      Returns any

Param: ev

The event.

MDN Reference

onformdata: null | ((this, ev) => any)

Type declaration

    • (this, ev): any
    • Parameters

      • this: GlobalEventHandlers
      • ev: FormDataEvent

      Returns any

onfullscreenchange: null | ((this, ev) => any)

Type declaration

    • (this, ev): any
    • Parameters

      Returns any

onfullscreenerror: null | ((this, ev) => any)

Type declaration

    • (this, ev): any
    • Parameters

      Returns any

ongotpointercapture: null | ((this, ev) => any)

Type declaration

    • (this, ev): any
    • Parameters

      • this: GlobalEventHandlers
      • ev: PointerEvent

      Returns any

oninput: null | ((this, ev) => any)

Type declaration

    • (this, ev): any
    • Parameters

      • this: GlobalEventHandlers
      • ev: Event

      Returns any

oninvalid: null | ((this, ev) => any)

Type declaration

    • (this, ev): any
    • Parameters

      • this: GlobalEventHandlers
      • ev: Event

      Returns any

onkeydown: null | ((this, ev) => any)

Fires when the user presses a key.

Type declaration

    • (this, ev): any
    • Parameters

      • this: GlobalEventHandlers
      • ev: KeyboardEvent

      Returns any

Param: ev

The keyboard event

MDN Reference

onkeypress: null | ((this, ev) => any)

Fires when the user presses an alphanumeric key.

Type declaration

    • (this, ev): any
    • Parameters

      • this: GlobalEventHandlers
      • ev: KeyboardEvent

      Returns any

Param: ev

The event.

Deprecated

MDN Reference

onkeyup: null | ((this, ev) => any)

Fires when the user releases a key.

Type declaration

    • (this, ev): any
    • Parameters

      • this: GlobalEventHandlers
      • ev: KeyboardEvent

      Returns any

Param: ev

The keyboard event

MDN Reference

onload: null | ((this, ev) => any)

Fires immediately after the browser loads the object.

Type declaration

    • (this, ev): any
    • Parameters

      • this: GlobalEventHandlers
      • ev: Event

      Returns any

Param: ev

The event.

MDN Reference

onloadeddata: null | ((this, ev) => any)

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

Type declaration

    • (this, ev): any
    • Parameters

      • this: GlobalEventHandlers
      • ev: Event

      Returns any

Param: ev

The event.

MDN Reference

onloadedmetadata: null | ((this, ev) => any)

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

Type declaration

    • (this, ev): any
    • Parameters

      • this: GlobalEventHandlers
      • ev: Event

      Returns any

Param: ev

The event.

MDN Reference

onloadstart: null | ((this, ev) => any)

Occurs when Internet Explorer begins looking for media data.

Type declaration

    • (this, ev): any
    • Parameters

      • this: GlobalEventHandlers
      • ev: Event

      Returns any

Param: ev

The event.

MDN Reference

onlostpointercapture: null | ((this, ev) => any)

Type declaration

    • (this, ev): any
    • Parameters

      • this: GlobalEventHandlers
      • ev: PointerEvent

      Returns any

onmousedown: null | ((this, ev) => any)

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

Type declaration

    • (this, ev): any
    • Parameters

      • this: GlobalEventHandlers
      • ev: MouseEvent

      Returns any

Param: ev

The mouse event.

MDN Reference

onmouseenter: null | ((this, ev) => any)

Type declaration

    • (this, ev): any
    • Parameters

      • this: GlobalEventHandlers
      • ev: MouseEvent

      Returns any

onmouseleave: null | ((this, ev) => any)

Type declaration

    • (this, ev): any
    • Parameters

      • this: GlobalEventHandlers
      • ev: MouseEvent

      Returns any

onmousemove: null | ((this, ev) => any)

Fires when the user moves the mouse over the object.

Type declaration

    • (this, ev): any
    • Parameters

      • this: GlobalEventHandlers
      • ev: MouseEvent

      Returns any

Param: ev

The mouse event.

MDN Reference

onmouseout: null | ((this, ev) => any)

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

Type declaration

    • (this, ev): any
    • Parameters

      • this: GlobalEventHandlers
      • ev: MouseEvent

      Returns any

Param: ev

The mouse event.

MDN Reference

onmouseover: null | ((this, ev) => any)

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

Type declaration

    • (this, ev): any
    • Parameters

      • this: GlobalEventHandlers
      • ev: MouseEvent

      Returns any

Param: ev

The mouse event.

MDN Reference

onmouseup: null | ((this, ev) => any)

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

Type declaration

    • (this, ev): any
    • Parameters

      • this: GlobalEventHandlers
      • ev: MouseEvent

      Returns any

Param: ev

The mouse event.

MDN Reference

onpaste: null | ((this, ev) => any)

Type declaration

    • (this, ev): any
    • Parameters

      • this: GlobalEventHandlers
      • ev: ClipboardEvent

      Returns any

onpause: null | ((this, ev) => any)

Occurs when playback is paused.

Type declaration

    • (this, ev): any
    • Parameters

      • this: GlobalEventHandlers
      • ev: Event

      Returns any

Param: ev

The event.

MDN Reference

onplay: null | ((this, ev) => any)

Occurs when the play method is requested.

Type declaration

    • (this, ev): any
    • Parameters

      • this: GlobalEventHandlers
      • ev: Event

      Returns any

Param: ev

The event.

MDN Reference

onplaying: null | ((this, ev) => any)

Occurs when the audio or video has started playing.

Type declaration

    • (this, ev): any
    • Parameters

      • this: GlobalEventHandlers
      • ev: Event

      Returns any

Param: ev

The event.

MDN Reference

onpointercancel: null | ((this, ev) => any)

Type declaration

    • (this, ev): any
    • Parameters

      • this: GlobalEventHandlers
      • ev: PointerEvent

      Returns any

onpointerdown: null | ((this, ev) => any)

Type declaration

    • (this, ev): any
    • Parameters

      • this: GlobalEventHandlers
      • ev: PointerEvent

      Returns any

onpointerenter: null | ((this, ev) => any)

Type declaration

    • (this, ev): any
    • Parameters

      • this: GlobalEventHandlers
      • ev: PointerEvent

      Returns any

onpointerleave: null | ((this, ev) => any)

Type declaration

    • (this, ev): any
    • Parameters

      • this: GlobalEventHandlers
      • ev: PointerEvent

      Returns any

onpointerlockchange: null | ((this, ev) => any)

Type declaration

    • (this, ev): any
    • Parameters

      Returns any

onpointerlockerror: null | ((this, ev) => any)

Type declaration

    • (this, ev): any
    • Parameters

      Returns any

onpointermove: null | ((this, ev) => any)

Type declaration

    • (this, ev): any
    • Parameters

      • this: GlobalEventHandlers
      • ev: PointerEvent

      Returns any

onpointerout: null | ((this, ev) => any)

Type declaration

    • (this, ev): any
    • Parameters

      • this: GlobalEventHandlers
      • ev: PointerEvent

      Returns any

onpointerover: null | ((this, ev) => any)

Type declaration

    • (this, ev): any
    • Parameters

      • this: GlobalEventHandlers
      • ev: PointerEvent

      Returns any

onpointerup: null | ((this, ev) => any)

Type declaration

    • (this, ev): any
    • Parameters

      • this: GlobalEventHandlers
      • ev: PointerEvent

      Returns any

onprogress: null | ((this, ev) => any)

Occurs to indicate progress while downloading media data.

Type declaration

    • (this, ev): any
    • Parameters

      • this: GlobalEventHandlers
      • ev: ProgressEvent<EventTarget>

      Returns any

Param: ev

The event.

MDN Reference

onratechange: null | ((this, ev) => any)

Occurs when the playback rate is increased or decreased.

Type declaration

    • (this, ev): any
    • Parameters

      • this: GlobalEventHandlers
      • ev: Event

      Returns any

Param: ev

The event.

MDN Reference

onreadystatechange: null | ((this, ev) => any)

Fires when the state of the object has changed.

Type declaration

    • (this, ev): any
    • Parameters

      Returns any

Param: ev

The event

MDN Reference

onreset: null | ((this, ev) => any)

Fires when the user resets a form.

Type declaration

    • (this, ev): any
    • Parameters

      • this: GlobalEventHandlers
      • ev: Event

      Returns any

Param: ev

The event.

MDN Reference

onresize: null | ((this, ev) => any)

Type declaration

    • (this, ev): any
    • Parameters

      • this: GlobalEventHandlers
      • ev: UIEvent

      Returns any

onscroll: null | ((this, ev) => any)

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

Type declaration

    • (this, ev): any
    • Parameters

      • this: GlobalEventHandlers
      • ev: Event

      Returns any

Param: ev

The event.

MDN Reference

onscrollend: null | ((this, ev) => any)

Type declaration

    • (this, ev): any
    • Parameters

      • this: GlobalEventHandlers
      • ev: Event

      Returns any

onsecuritypolicyviolation: null | ((this, ev) => any)

Type declaration

    • (this, ev): any
    • Parameters

      • this: GlobalEventHandlers
      • ev: SecurityPolicyViolationEvent

      Returns any

onseeked: null | ((this, ev) => any)

Occurs when the seek operation ends.

Type declaration

    • (this, ev): any
    • Parameters

      • this: GlobalEventHandlers
      • ev: Event

      Returns any

Param: ev

The event.

MDN Reference

onseeking: null | ((this, ev) => any)

Occurs when the current playback position is moved.

Type declaration

    • (this, ev): any
    • Parameters

      • this: GlobalEventHandlers
      • ev: Event

      Returns any

Param: ev

The event.

MDN Reference

onselect: null | ((this, ev) => any)

Fires when the current selection changes.

Type declaration

    • (this, ev): any
    • Parameters

      • this: GlobalEventHandlers
      • ev: Event

      Returns any

Param: ev

The event.

MDN Reference

onselectionchange: null | ((this, ev) => any)

Type declaration

    • (this, ev): any
    • Parameters

      • this: GlobalEventHandlers
      • ev: Event

      Returns any

onselectstart: null | ((this, ev) => any)

Type declaration

    • (this, ev): any
    • Parameters

      • this: GlobalEventHandlers
      • ev: Event

      Returns any

onslotchange: null | ((this, ev) => any)

Type declaration

    • (this, ev): any
    • Parameters

      • this: GlobalEventHandlers
      • ev: Event

      Returns any

onstalled: null | ((this, ev) => any)

Occurs when the download has stopped.

Type declaration

    • (this, ev): any
    • Parameters

      • this: GlobalEventHandlers
      • ev: Event

      Returns any

Param: ev

The event.

MDN Reference

onsubmit: null | ((this, ev) => any)

Type declaration

    • (this, ev): any
    • Parameters

      • this: GlobalEventHandlers
      • ev: SubmitEvent

      Returns any

onsuspend: null | ((this, ev) => any)

Occurs if the load operation has been intentionally halted.

Type declaration

    • (this, ev): any
    • Parameters

      • this: GlobalEventHandlers
      • ev: Event

      Returns any

Param: ev

The event.

MDN Reference

ontimeupdate: null | ((this, ev) => any)

Occurs to indicate the current playback position.

Type declaration

    • (this, ev): any
    • Parameters

      • this: GlobalEventHandlers
      • ev: Event

      Returns any

Param: ev

The event.

MDN Reference

ontoggle: null | ((this, ev) => any)

Type declaration

    • (this, ev): any
    • Parameters

      • this: GlobalEventHandlers
      • ev: Event

      Returns any

ontouchcancel?: null | ((this, ev) => any)

Type declaration

    • (this, ev): any
    • Parameters

      • this: GlobalEventHandlers
      • ev: TouchEvent

      Returns any

ontouchend?: null | ((this, ev) => any)

Type declaration

    • (this, ev): any
    • Parameters

      • this: GlobalEventHandlers
      • ev: TouchEvent

      Returns any

ontouchmove?: null | ((this, ev) => any)

Type declaration

    • (this, ev): any
    • Parameters

      • this: GlobalEventHandlers
      • ev: TouchEvent

      Returns any

ontouchstart?: null | ((this, ev) => any)

Type declaration

    • (this, ev): any
    • Parameters

      • this: GlobalEventHandlers
      • ev: TouchEvent

      Returns any

ontransitioncancel: null | ((this, ev) => any)

Type declaration

    • (this, ev): any
    • Parameters

      • this: GlobalEventHandlers
      • ev: TransitionEvent

      Returns any

ontransitionend: null | ((this, ev) => any)

Type declaration

    • (this, ev): any
    • Parameters

      • this: GlobalEventHandlers
      • ev: TransitionEvent

      Returns any

ontransitionrun: null | ((this, ev) => any)

Type declaration

    • (this, ev): any
    • Parameters

      • this: GlobalEventHandlers
      • ev: TransitionEvent

      Returns any

ontransitionstart: null | ((this, ev) => any)

Type declaration

    • (this, ev): any
    • Parameters

      • this: GlobalEventHandlers
      • ev: TransitionEvent

      Returns any

onvisibilitychange: null | ((this, ev) => any)

Type declaration

    • (this, ev): any
    • Parameters

      Returns any

onvolumechange: null | ((this, ev) => any)

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

Type declaration

    • (this, ev): any
    • Parameters

      • this: GlobalEventHandlers
      • ev: Event

      Returns any

Param: ev

The event.

MDN Reference

onwaiting: null | ((this, ev) => any)

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

Type declaration

    • (this, ev): any
    • Parameters

      • this: GlobalEventHandlers
      • ev: Event

      Returns any

Param: ev

The event.

MDN Reference

onwebkitanimationend: null | ((this, ev) => any)

Type declaration

    • (this, ev): any
    • Parameters

      • this: GlobalEventHandlers
      • ev: Event

      Returns any

Deprecated

This is a legacy alias of onanimationend.

MDN Reference

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

Type declaration

    • (this, ev): any
    • Parameters

      • this: GlobalEventHandlers
      • ev: Event

      Returns any

Deprecated

This is a legacy alias of onanimationiteration.

MDN Reference

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

Type declaration

    • (this, ev): any
    • Parameters

      • this: GlobalEventHandlers
      • ev: Event

      Returns any

Deprecated

This is a legacy alias of onanimationstart.

MDN Reference

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

Type declaration

    • (this, ev): any
    • Parameters

      • this: GlobalEventHandlers
      • ev: Event

      Returns any

Deprecated

This is a legacy alias of ontransitionend.

MDN Reference

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

Type declaration

    • (this, ev): any
    • Parameters

      • this: GlobalEventHandlers
      • ev: WheelEvent

      Returns any

ownerDocument: null
parentElement: null | HTMLElement

Returns the parent element.

MDN Reference

parentNode: null | ParentNode

Returns the parent.

MDN Reference

pictureInPictureElement: null | Element
pictureInPictureEnabled: boolean
plugins: HTMLCollectionOf<HTMLEmbedElement>

Return an HTMLCollection of the embed elements in the Document.

MDN Reference

pointerLockElement: null | Element
previousSibling: null | ChildNode

Returns the previous sibling.

MDN Reference

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: null | SVGSVGElement

Deprecated

MDN Reference

scripts: HTMLCollectionOf<HTMLScriptElement>

Retrieves a collection of all script objects in the document.

MDN Reference

scrollingElement: null | 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

textContent: null | string
timeline: DocumentTimeline
title: string

Contains the title of the document.

MDN Reference

visibilityState: DocumentVisibilityState
vlinkColor: string

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

Deprecated

MDN Reference

Accessors

  • get location(): Location
  • Contains information about the current URL.

    MDN Reference

    Returns Location

  • set location(href): void
  • Parameters

    • href: string | Location

    Returns void

Methods

  • Type Parameters

    • K extends keyof DocumentEventMap

    Parameters

    • type: K
    • listener: ((this, ev) => any)
        • (this, ev): any
        • Parameters

          Returns any

    • Optional options: boolean | AddEventListenerOptions

    Returns void

  • Parameters

    • type: string
    • listener: EventListenerOrEventListenerObject
    • Optional options: boolean | AddEventListenerOptions

    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

    • T extends Node

    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

  • Type Parameters

    • T extends Node

    Parameters

    • node: T

    Returns T

  • Returns void

    Deprecated

    MDN Reference

  • Parameters

    • x: number
    • y: number

    Returns null | Range

    Deprecated

  • Returns void

    Deprecated

    MDN Reference

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

    MDN Reference

    Parameters

    • Optional deep: boolean

    Returns Node

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

    MDN Reference

    Returns void

  • Returns a bitmask indicating the position of other relative to node.

    MDN Reference

    Parameters

    • other: Node

    Returns number

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

    MDN Reference

    Parameters

    • other: null | Node

    Returns boolean

  • Creates an attribute object with a specified name.

    Parameters

    • localName: string

    Returns Attr

  • Parameters

    • namespace: null | string
    • qualifiedName: string

    Returns Attr

  • Returns a CDATASection node whose data is data.

    MDN Reference

    Parameters

    • data: string

    Returns CDATASection

  • Creates a comment object with the specified data.

    Parameters

    Returns Comment

  • Creates a new document.

    MDN Reference

    Returns DocumentFragment

  • Creates an instance of the element for the specified tag.

    Type Parameters

    • K extends keyof HTMLElementTagNameMap

    Parameters

    • tagName: K

      The name of an element.

      MDN Reference

    • Optional options: ElementCreationOptions

    Returns HTMLElementTagNameMap[K]

  • Type Parameters

    • K extends keyof HTMLElementDeprecatedTagNameMap

    Parameters

    • tagName: K
    • Optional options: ElementCreationOptions

    Returns HTMLElementDeprecatedTagNameMap[K]

    Deprecated

  • Parameters

    • tagName: string
    • Optional options: ElementCreationOptions

    Returns HTMLElement

  • 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

    • K extends keyof SVGElementTagNameMap

    Parameters

    • namespaceURI: "http://www.w3.org/2000/svg"
    • qualifiedName: K

    Returns SVGElementTagNameMap[K]

  • Parameters

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

    Returns SVGElement

  • Type Parameters

    • K extends keyof MathMLElementTagNameMap

    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

    • namespaceURI: null | string
    • qualifiedName: string
    • Optional options: ElementCreationOptions

    Returns Element

  • Parameters

    • namespace: null | string
    • qualifiedName: string
    • Optional options: string | ElementCreationOptions

    Returns Element

  • Parameters

    • eventInterface: "AnimationEvent"

    Returns AnimationEvent

  • Parameters

    • eventInterface: "AnimationPlaybackEvent"

    Returns AnimationPlaybackEvent

  • Parameters

    • eventInterface: "AudioProcessingEvent"

    Returns AudioProcessingEvent

  • Parameters

    • eventInterface: "BeforeUnloadEvent"

    Returns BeforeUnloadEvent

  • Parameters

    • eventInterface: "BlobEvent"

    Returns BlobEvent

  • Parameters

    • eventInterface: "ClipboardEvent"

    Returns ClipboardEvent

  • Parameters

    • eventInterface: "CloseEvent"

    Returns CloseEvent

  • Parameters

    • eventInterface: "CompositionEvent"

    Returns CompositionEvent

  • Parameters

    • eventInterface: "CustomEvent"

    Returns CustomEvent<any>

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

  • Parameters

    • eventInterface: "MouseEvent"

    Returns MouseEvent

  • Parameters

    • eventInterface: "MouseEvents"

    Returns MouseEvent

  • Parameters

    • eventInterface: "MutationEvent"

    Returns MutationEvent

  • Parameters

    • eventInterface: "MutationEvents"

    Returns MutationEvent

  • Parameters

    • eventInterface: "OfflineAudioCompletionEvent"

    Returns OfflineAudioCompletionEvent

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

  • 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: "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

  • Parameters

    • expression: string
    • Optional resolver: null | XPathNSResolver

    Returns XPathExpression

  • Parameters

    • nodeResolver: Node

    Returns Node

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

    • Optional whatToShow: number

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

    • Optional filter: null | 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.

    • Optional whatToShow: number

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

    • Optional filter: null | 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

    • event: Event

    Returns boolean

  • Returns the element for the specified x coordinate and the specified y coordinate.

    Parameters

    • x: number

      The x-offset

    • y: number

      The y-offset

    Returns null | Element

  • Parameters

    • x: number
    • y: number

    Returns Element[]

  • Parameters

    • expression: string
    • contextNode: Node
    • Optional resolver: null | XPathNSResolver
    • Optional type: number
    • Optional result: null | XPathResult

    Returns XPathResult

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

    • Optional showUI: boolean

      Display the user interface, defaults to false.

    • Optional value: string

      Value to assign.

    Returns boolean

    Deprecated

    MDN Reference

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

    MDN Reference

    Returns Promise<void>

  • Returns Promise<void>

  • Returns void

  • Returns Animation[]

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

    Parameters

    • elementId: string

      String that specifies the ID value.

    Returns null | HTMLElement

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

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

    Type Parameters

    • K extends keyof HTMLElementTagNameMap

    Parameters

    • qualifiedName: K

    Returns HTMLCollectionOf<HTMLElementTagNameMap[K]>

  • Type Parameters

    • K extends keyof SVGElementTagNameMap

    Parameters

    • qualifiedName: K

    Returns HTMLCollectionOf<SVGElementTagNameMap[K]>

  • Type Parameters

    • K extends keyof MathMLElementTagNameMap

    Parameters

    • qualifiedName: K

    Returns HTMLCollectionOf<MathMLElementTagNameMap[K]>

  • Type Parameters

    • K extends keyof HTMLElementDeprecatedTagNameMap

    Parameters

    • qualifiedName: K

    Returns HTMLCollectionOf<HTMLElementDeprecatedTagNameMap[K]>

    Deprecated

  • Parameters

    • qualifiedName: string

    Returns HTMLCollectionOf<Element>

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

    Returns HTMLCollectionOf<Element>

  • Returns node's root.

    MDN Reference

    Parameters

    • Optional options: GetRootNodeOptions

    Returns Node

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

    MDN Reference

    Returns null | Selection

  • Returns whether node has children.

    MDN Reference

    Returns boolean

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

    MDN Reference

    Returns boolean

  • Returns Promise<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

    • T extends Node

    Parameters

    • node: T
    • Optional deep: boolean

    Returns T

  • Type Parameters

    • T extends Node

    Parameters

    • node: T
    • child: null | Node

    Returns T

  • Parameters

    • namespace: null | string

    Returns boolean

  • Returns whether node and otherNode have the same properties.

    MDN Reference

    Parameters

    • otherNode: null | Node

    Returns boolean

  • Parameters

    • otherNode: null | Node

    Returns boolean

  • Parameters

    • prefix: null | string

    Returns null | string

  • Parameters

    • namespace: null | string

    Returns null | string

  • 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

    • Optional unused1: string
    • Optional unused2: string

    Returns Document

  • Parameters

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

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

    Deprecated

    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

    Deprecated

    MDN Reference

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

    Parameters

    • commandId: string

      String that specifies a command identifier.

    Returns boolean

    Deprecated

    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

    Deprecated

    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

    Deprecated

    MDN Reference

  • Returns the first element that is a descendant of node that matches selectors.

    MDN Reference

    Type Parameters

    • K extends keyof HTMLElementTagNameMap

    Parameters

    • selectors: K

    Returns null | HTMLElementTagNameMap[K]

  • Type Parameters

    • K extends keyof SVGElementTagNameMap

    Parameters

    • selectors: K

    Returns null | SVGElementTagNameMap[K]

  • Type Parameters

    • K extends keyof MathMLElementTagNameMap

    Parameters

    • selectors: K

    Returns null | MathMLElementTagNameMap[K]

  • Type Parameters

    • K extends keyof HTMLElementDeprecatedTagNameMap

    Parameters

    • selectors: K

    Returns null | HTMLElementDeprecatedTagNameMap[K]

    Deprecated

  • Type Parameters

    • E extends Element = Element

    Parameters

    • selectors: string

    Returns null | E

  • Returns all element descendants of node that match selectors.

    MDN Reference

    Type Parameters

    • K extends keyof HTMLElementTagNameMap

    Parameters

    • selectors: K

    Returns NodeListOf<HTMLElementTagNameMap[K]>

  • Type Parameters

    • K extends keyof SVGElementTagNameMap

    Parameters

    • selectors: K

    Returns NodeListOf<SVGElementTagNameMap[K]>

  • Type Parameters

    • K extends keyof MathMLElementTagNameMap

    Parameters

    • selectors: K

    Returns NodeListOf<MathMLElementTagNameMap[K]>

  • Type Parameters

    • K extends keyof HTMLElementDeprecatedTagNameMap

    Parameters

    • selectors: K

    Returns NodeListOf<HTMLElementDeprecatedTagNameMap[K]>

    Deprecated

  • Type Parameters

    • E extends Element = Element

    Parameters

    • selectors: string

    Returns NodeListOf<E>

  • Returns void

    Deprecated

    MDN Reference

  • Type Parameters

    • T extends Node

    Parameters

    • child: T

    Returns T

  • Type Parameters

    • K extends keyof DocumentEventMap

    Parameters

    • type: K
    • listener: ((this, ev) => any)
        • (this, ev): any
        • Parameters

          Returns any

    • Optional options: boolean | EventListenerOptions

    Returns void

  • Parameters

    • type: string
    • listener: EventListenerOrEventListenerObject
    • Optional options: boolean | EventListenerOptions

    Returns void

  • Type Parameters

    • T extends Node

    Parameters

    • node: Node
    • child: T

    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

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

    Returns void

  • Returns Promise<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

Generated using TypeDoc