Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface IDocument

Hierarchy

Index

Properties

Methods

Properties

Readonly ATTRIBUTE_NODE

ATTRIBUTE_NODE: number

Readonly CDATA_SECTION_NODE

CDATA_SECTION_NODE: number

node is a CDATASection node.

Readonly COMMENT_NODE

COMMENT_NODE: number

node is a Comment node.

Readonly DOCUMENT_FRAGMENT_NODE

DOCUMENT_FRAGMENT_NODE: number

node is a DocumentFragment node.

Readonly DOCUMENT_NODE

DOCUMENT_NODE: number

node is a document.

Readonly DOCUMENT_POSITION_CONTAINED_BY

DOCUMENT_POSITION_CONTAINED_BY: number

Set when other is a descendant of node.

Readonly DOCUMENT_POSITION_CONTAINS

DOCUMENT_POSITION_CONTAINS: number

Set when other is an ancestor of node.

Readonly DOCUMENT_POSITION_DISCONNECTED

DOCUMENT_POSITION_DISCONNECTED: number

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

Readonly DOCUMENT_POSITION_FOLLOWING

DOCUMENT_POSITION_FOLLOWING: number

Set when other is following node.

Readonly DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC

DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: number

Readonly DOCUMENT_POSITION_PRECEDING

DOCUMENT_POSITION_PRECEDING: number

Set when other is preceding node.

Readonly DOCUMENT_TYPE_NODE

DOCUMENT_TYPE_NODE: number

node is a doctype.

Document

Document: { constructor: any; prototype: Document }

Type declaration

  • constructor: function
    • Returns Document

  • prototype: Document

Readonly ELEMENT_NODE

ELEMENT_NODE: number

node is an element.

Readonly ENTITY_NODE

ENTITY_NODE: number

Readonly ENTITY_REFERENCE_NODE

ENTITY_REFERENCE_NODE: number

Readonly NOTATION_NODE

NOTATION_NODE: number

Readonly PROCESSING_INSTRUCTION_NODE

PROCESSING_INSTRUCTION_NODE: number

node is a ProcessingInstruction node.

Readonly TEXT_NODE

TEXT_NODE: number

node is a Text node.

Readonly URL

URL: string

Sets or gets the URL for the current document.

Readonly activeElement

activeElement: Element | null

alinkColor

alinkColor: string
deprecated

Readonly all

all: HTMLAllCollection
deprecated

Readonly anchors

anchors: HTMLCollectionOf<HTMLAnchorElement>
deprecated

Readonly applets

applets: HTMLCollectionOf<HTMLAppletElement>
deprecated

Readonly baseURI

baseURI: string

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

bgColor

bgColor: string
deprecated

body

body: HTMLElement

Specifies the beginning and end of the document body.

Readonly characterSet

characterSet: string

Returns document's encoding.

Readonly charset

charset: string

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

Readonly childElementCount

childElementCount: number

Readonly childNodes

childNodes: NodeListOf<ChildNode>

Returns the children.

Readonly children

children: HTMLCollection

Returns the child elements.

Readonly compatMode

compatMode: string

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

Readonly contentType

contentType: string

Returns document's content type.

cookie

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.

Readonly currentScript

currentScript: HTMLOrSVGScriptElement | null

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

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

Readonly defaultView

defaultView: (WindowProxy & typeof globalThis) | null

designMode

designMode: string

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

dir

dir: string

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

Readonly doctype

doctype: DocumentType | null

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

Readonly documentElement

documentElement: HTMLElement

Gets a reference to the root node of the document.

Readonly documentURI

documentURI: string

Returns document's URL.

domain

domain: string

Sets or gets the security domain of the document.

Readonly embeds

embeds: HTMLCollectionOf<HTMLEmbedElement>

Retrieves a collection of all embed objects in the document.

fgColor

fgColor: string
deprecated

Readonly firstChild

firstChild: ChildNode | null

Returns the first child.

Readonly firstElementChild

firstElementChild: Element | null

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

Readonly forms

forms: HTMLCollectionOf<HTMLFormElement>

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

Readonly fullscreen

fullscreen: boolean
deprecated

Readonly fullscreenElement

fullscreenElement: Element | null

Returns document's fullscreen element.

Readonly fullscreenEnabled

fullscreenEnabled: boolean

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

Readonly head

head: HTMLHeadElement

Returns the head element.

Readonly hidden

hidden: boolean

Readonly images

images: HTMLCollectionOf<HTMLImageElement>

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

Readonly implementation

implementation: DOMImplementation

Gets the implementation object of the current document.

Readonly inputEncoding

inputEncoding: string

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

Readonly isConnected

isConnected: boolean

Returns true if node is connected and false otherwise.

Readonly lastChild

lastChild: ChildNode | null

Returns the last child.

Readonly lastElementChild

lastElementChild: Element | null

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

Readonly lastModified

lastModified: string

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

linkColor

linkColor: string
deprecated

Readonly links

links: HTMLCollectionOf<HTMLAnchorElement | HTMLAreaElement>

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

location

location: Location

Contains information about the current URL.

Readonly namespaceURI

namespaceURI: string | null
deprecated

Readonly nextSibling

nextSibling: ChildNode | null

Returns the next sibling.

Readonly nodeName

nodeName: string

Returns a string appropriate for the type of node.

Readonly nodeType

nodeType: number

Returns the type of node.

nodeValue

nodeValue: string | null

onabort

onabort: ((this: GlobalEventHandlers, ev: UIEvent) => any) | null

Fires when the user aborts the download.

param

The event.

onanimationcancel

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

onanimationend

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

onanimationiteration

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

onanimationstart

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

onauxclick

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

onblur

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

Fires when the object loses the input focus.

param

The focus event.

oncancel

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

oncanplay

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

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

param

The event.

oncanplaythrough

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

onchange

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

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

param

The event.

onclick

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

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

param

The mouse event.

onclose

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

oncontextmenu

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

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

param

The mouse event.

oncopy

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

oncuechange

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

oncut

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

ondblclick

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

Fires when the user double-clicks the object.

param

The mouse event.

ondrag

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

Fires on the source object continuously during a drag operation.

param

The event.

ondragend

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

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

param

The event.

ondragenter

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

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

param

The drag event.

ondragexit

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

ondragleave

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

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

param

The drag event.

ondragover

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

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

param

The event.

ondragstart

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

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

param

The event.

ondrop

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

ondurationchange

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

Occurs when the duration attribute is updated.

param

The event.

onemptied

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

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

param

The event.

onended

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

Occurs when the end of playback is reached.

param

The event

onerror

onerror: OnErrorEventHandler

Fires when an error occurs during object loading.

param

The event.

onfocus

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

Fires when the object receives focus.

param

The event.

onfullscreenchange

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

onfullscreenerror

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

ongotpointercapture

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

oninput

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

oninvalid

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

onkeydown

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

Fires when the user presses a key.

param

The keyboard event

onkeypress

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

Fires when the user presses an alphanumeric key.

param

The event.

onkeyup

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

Fires when the user releases a key.

param

The keyboard event

onload

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

Fires immediately after the browser loads the object.

param

The event.

onloadeddata

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

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

param

The event.

onloadedmetadata

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

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

param

The event.

onloadstart

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

Occurs when Internet Explorer begins looking for media data.

param

The event.

onlostpointercapture

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

onmousedown

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

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

param

The mouse event.

onmouseenter

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

onmouseleave

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

onmousemove

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

Fires when the user moves the mouse over the object.

param

The mouse event.

onmouseout

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

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

param

The mouse event.

onmouseover

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

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

param

The mouse event.

onmouseup

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

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

param

The mouse event.

onpaste

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

onpause

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

Occurs when playback is paused.

param

The event.

onplay

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

Occurs when the play method is requested.

param

The event.

onplaying

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

Occurs when the audio or video has started playing.

param

The event.

onpointercancel

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

onpointerdown

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

onpointerenter

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

onpointerleave

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

onpointerlockchange

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

onpointerlockerror

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

onpointermove

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

onpointerout

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

onpointerover

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

onpointerup

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

onprogress

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

Occurs to indicate progress while downloading media data.

param

The event.

onratechange

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

Occurs when the playback rate is increased or decreased.

param

The event.

onreadystatechange

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

Fires when the state of the object has changed.

param

The event

onreset

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

Fires when the user resets a form.

param

The event.

onresize

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

onscroll

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

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

param

The event.

onsecuritypolicyviolation

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

onseeked

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

Occurs when the seek operation ends.

param

The event.

onseeking

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

Occurs when the current playback position is moved.

param

The event.

onselect

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

Fires when the current selection changes.

param

The event.

onselectionchange

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

onselectstart

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

onstalled

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

Occurs when the download has stopped.

param

The event.

onsubmit

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

onsuspend

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

Occurs if the load operation has been intentionally halted.

param

The event.

ontimeupdate

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

Occurs to indicate the current playback position.

param

The event.

ontoggle

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

Optional ontouchcancel

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

Optional ontouchend

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

Optional ontouchmove

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

Optional ontouchstart

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

ontransitioncancel

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

ontransitionend

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

ontransitionrun

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

ontransitionstart

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

onvisibilitychange

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

onvolumechange

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

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

param

The event.

onwaiting

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

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

param

The event.

onwheel

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

Readonly ownerDocument

ownerDocument: null

Readonly parentElement

parentElement: HTMLElement | null

Returns the parent element.

Readonly parentNode

parentNode: (Node & ParentNode) | null

Returns the parent.

Readonly plugins

plugins: HTMLCollectionOf<HTMLEmbedElement>

Return an HTMLCollection of the embed elements in the Document.

Readonly pointerLockElement

pointerLockElement: Element | null

Readonly previousSibling

previousSibling: ChildNode | null

Returns the previous sibling.

Readonly readyState

readyState: DocumentReadyState

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

Readonly referrer

referrer: string

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

Readonly scripts

scripts: HTMLCollectionOf<HTMLScriptElement>

Retrieves a collection of all script objects in the document.

Readonly scrollingElement

scrollingElement: Element | null

Readonly styleSheets

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.

textContent

textContent: string | null

Readonly timeline

timeline: DocumentTimeline

title

title: string

Contains the title of the document.

Readonly visibilityState

visibilityState: VisibilityState

vlinkColor

vlinkColor: string
deprecated

Methods

addEventListener

  • addEventListener<K>(type: K, listener: (this: Document, ev: DocumentEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void
  • addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void
  • Type parameters

    • K: keyof DocumentEventMap

    Parameters

    • type: K
    • listener: (this: Document, ev: DocumentEventMap[K]) => any
        • (this: Document, ev: DocumentEventMap[K]): any
        • Parameters

          • this: Document
          • ev: DocumentEventMap[K]

          Returns any

    • Optional options: boolean | AddEventListenerOptions

    Returns void

  • Parameters

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

    Returns void

adoptNode

  • adoptNode<T>(source: T): T
  • 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.

    Type parameters

    • T: Node

    Parameters

    • source: T

    Returns T

append

  • append(...nodes: (Node | string)[]): void
  • Inserts nodes after the last child of node, while replacing strings in nodes with equivalent Text nodes.

    Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated.

    Parameters

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

    Returns void

appendChild

  • appendChild<T>(newChild: T): T
  • Type parameters

    • T: Node

    Parameters

    • newChild: T

    Returns T

captureEvents

  • captureEvents(): void
  • deprecated

    Returns void

caretPositionFromPoint

  • caretPositionFromPoint(x: number, y: number): CaretPosition | null
  • Parameters

    • x: number
    • y: number

    Returns CaretPosition | null

caretRangeFromPoint

  • caretRangeFromPoint(x: number, y: number): Range
  • deprecated

    Parameters

    • x: number
    • y: number

    Returns Range

clear

  • clear(): void
  • deprecated

    Returns void

cloneNode

  • cloneNode(deep?: undefined | false | true): Node
  • Returns a copy of node. If deep is true, the copy also includes the node's descendants.

    Parameters

    • Optional deep: undefined | false | true

    Returns Node

close

  • close(): void
  • Closes an output stream and forces the sent data to display.

    Returns void

compareDocumentPosition

  • compareDocumentPosition(other: Node): number
  • Returns a bitmask indicating the position of other relative to node.

    Parameters

    • other: Node

    Returns number

contains

  • contains(other: Node | null): boolean
  • Returns true if other is an inclusive descendant of node, and false otherwise.

    Parameters

    • other: Node | null

    Returns boolean

createAttribute

  • createAttribute(localName: string): Attr
  • Creates an attribute object with a specified name.

    Parameters

    • localName: string

    Returns Attr

createAttributeNS

  • createAttributeNS(namespace: string | null, qualifiedName: string): Attr
  • Parameters

    • namespace: string | null
    • qualifiedName: string

    Returns Attr

createCDATASection

  • createCDATASection(data: string): CDATASection
  • Returns a CDATASection node whose data is data.

    Parameters

    • data: string

    Returns CDATASection

createComment

  • createComment(data: string): Comment
  • Creates a comment object with the specified data.

    Parameters

    • data: string

      Sets the comment object's data.

    Returns Comment

createDocumentFragment

  • createDocumentFragment(): DocumentFragment
  • Creates a new document.

    Returns DocumentFragment

createElement

  • createElement<K>(tagName: K, options?: ElementCreationOptions): HTMLElementTagNameMap[K]
  • createElement<K>(tagName: K, options?: ElementCreationOptions): HTMLElementDeprecatedTagNameMap[K]
  • createElement(tagName: string, options?: ElementCreationOptions): HTMLElement
  • Creates an instance of the element for the specified tag.

    Type parameters

    • K: keyof HTMLElementTagNameMap

    Parameters

    • tagName: K

      The name of an element.

    • Optional options: ElementCreationOptions

    Returns HTMLElementTagNameMap[K]

  • deprecated

    Type parameters

    • K: keyof HTMLElementDeprecatedTagNameMap

    Parameters

    • tagName: K
    • Optional options: ElementCreationOptions

    Returns HTMLElementDeprecatedTagNameMap[K]

  • Parameters

    • tagName: string
    • Optional options: ElementCreationOptions

    Returns HTMLElement

createElementNS

  • 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(namespaceURI: string | null, qualifiedName: string, options?: ElementCreationOptions): Element
  • createElementNS(namespace: string | null, qualifiedName: string, options?: string | ElementCreationOptions): Element
  • 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.

    Parameters

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

    Returns HTMLElement

  • Type parameters

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

  • Parameters

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

    Returns Element

  • Parameters

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

    Returns Element

createEvent

  • createEvent(eventInterface: "AnimationEvent"): AnimationEvent
  • createEvent(eventInterface: "AnimationPlaybackEvent"): AnimationPlaybackEvent
  • createEvent(eventInterface: "AudioProcessingEvent"): AudioProcessingEvent
  • createEvent(eventInterface: "BeforeUnloadEvent"): BeforeUnloadEvent
  • createEvent(eventInterface: "ClipboardEvent"): ClipboardEvent
  • createEvent(eventInterface: "CloseEvent"): CloseEvent
  • createEvent(eventInterface: "CompositionEvent"): CompositionEvent
  • createEvent(eventInterface: "CustomEvent"): CustomEvent
  • createEvent(eventInterface: "DeviceLightEvent"): DeviceLightEvent
  • 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: "FocusNavigationEvent"): FocusNavigationEvent
  • createEvent(eventInterface: "GamepadEvent"): GamepadEvent
  • createEvent(eventInterface: "HashChangeEvent"): HashChangeEvent
  • createEvent(eventInterface: "IDBVersionChangeEvent"): IDBVersionChangeEvent
  • createEvent(eventInterface: "InputEvent"): InputEvent
  • createEvent(eventInterface: "KeyboardEvent"): KeyboardEvent
  • createEvent(eventInterface: "ListeningStateChangedEvent"): ListeningStateChangedEvent
  • createEvent(eventInterface: "MSGestureEvent"): MSGestureEvent
  • createEvent(eventInterface: "MSMediaKeyMessageEvent"): MSMediaKeyMessageEvent
  • createEvent(eventInterface: "MSMediaKeyNeededEvent"): MSMediaKeyNeededEvent
  • createEvent(eventInterface: "MSPointerEvent"): MSPointerEvent
  • createEvent(eventInterface: "MediaEncryptedEvent"): MediaEncryptedEvent
  • createEvent(eventInterface: "MediaKeyMessageEvent"): MediaKeyMessageEvent
  • createEvent(eventInterface: "MediaQueryListEvent"): MediaQueryListEvent
  • createEvent(eventInterface: "MediaStreamErrorEvent"): MediaStreamErrorEvent
  • createEvent(eventInterface: "MediaStreamEvent"): MediaStreamEvent
  • createEvent(eventInterface: "MediaStreamTrackEvent"): MediaStreamTrackEvent
  • createEvent(eventInterface: "MessageEvent"): MessageEvent
  • createEvent(eventInterface: "MouseEvent"): MouseEvent
  • createEvent(eventInterface: "MouseEvents"): MouseEvent
  • createEvent(eventInterface: "MutationEvent"): MutationEvent
  • createEvent(eventInterface: "MutationEvents"): MutationEvent
  • createEvent(eventInterface: "OfflineAudioCompletionEvent"): OfflineAudioCompletionEvent
  • createEvent(eventInterface: "OverflowEvent"): OverflowEvent
  • createEvent(eventInterface: "PageTransitionEvent"): PageTransitionEvent
  • createEvent(eventInterface: "PaymentRequestUpdateEvent"): PaymentRequestUpdateEvent
  • createEvent(eventInterface: "PermissionRequestedEvent"): PermissionRequestedEvent
  • createEvent(eventInterface: "PointerEvent"): PointerEvent
  • createEvent(eventInterface: "PopStateEvent"): PopStateEvent
  • createEvent(eventInterface: "ProgressEvent"): ProgressEvent
  • createEvent(eventInterface: "PromiseRejectionEvent"): PromiseRejectionEvent
  • createEvent(eventInterface: "RTCDTMFToneChangeEvent"): RTCDTMFToneChangeEvent
  • createEvent(eventInterface: "RTCDataChannelEvent"): RTCDataChannelEvent
  • createEvent(eventInterface: "RTCDtlsTransportStateChangedEvent"): RTCDtlsTransportStateChangedEvent
  • createEvent(eventInterface: "RTCErrorEvent"): RTCErrorEvent
  • createEvent(eventInterface: "RTCIceCandidatePairChangedEvent"): RTCIceCandidatePairChangedEvent
  • createEvent(eventInterface: "RTCIceGathererEvent"): RTCIceGathererEvent
  • createEvent(eventInterface: "RTCIceTransportStateChangedEvent"): RTCIceTransportStateChangedEvent
  • createEvent(eventInterface: "RTCPeerConnectionIceErrorEvent"): RTCPeerConnectionIceErrorEvent
  • createEvent(eventInterface: "RTCPeerConnectionIceEvent"): RTCPeerConnectionIceEvent
  • createEvent(eventInterface: "RTCSsrcConflictEvent"): RTCSsrcConflictEvent
  • createEvent(eventInterface: "RTCStatsEvent"): RTCStatsEvent
  • createEvent(eventInterface: "RTCTrackEvent"): RTCTrackEvent
  • createEvent(eventInterface: "SVGZoomEvent"): SVGZoomEvent
  • createEvent(eventInterface: "SVGZoomEvents"): SVGZoomEvent
  • createEvent(eventInterface: "SecurityPolicyViolationEvent"): SecurityPolicyViolationEvent
  • createEvent(eventInterface: "ServiceWorkerMessageEvent"): ServiceWorkerMessageEvent
  • createEvent(eventInterface: "SpeechRecognitionEvent"): SpeechRecognitionEvent
  • createEvent(eventInterface: "SpeechSynthesisErrorEvent"): SpeechSynthesisErrorEvent
  • createEvent(eventInterface: "SpeechSynthesisEvent"): SpeechSynthesisEvent
  • createEvent(eventInterface: "StorageEvent"): StorageEvent
  • createEvent(eventInterface: "TextEvent"): TextEvent
  • createEvent(eventInterface: "TouchEvent"): TouchEvent
  • createEvent(eventInterface: "TrackEvent"): TrackEvent
  • createEvent(eventInterface: "TransitionEvent"): TransitionEvent
  • createEvent(eventInterface: "UIEvent"): UIEvent
  • createEvent(eventInterface: "UIEvents"): UIEvent
  • createEvent(eventInterface: "VRDisplayEvent"): VRDisplayEvent
  • createEvent(eventInterface: "VRDisplayEvent "): VRDisplayEvent
  • createEvent(eventInterface: "WebGLContextEvent"): WebGLContextEvent
  • createEvent(eventInterface: "WheelEvent"): WheelEvent
  • createEvent(eventInterface: string): Event
  • Parameters

    • eventInterface: "AnimationEvent"

    Returns AnimationEvent

  • Parameters

    • eventInterface: "AnimationPlaybackEvent"

    Returns AnimationPlaybackEvent

  • Parameters

    • eventInterface: "AudioProcessingEvent"

    Returns AudioProcessingEvent

  • Parameters

    • eventInterface: "BeforeUnloadEvent"

    Returns BeforeUnloadEvent

  • Parameters

    • eventInterface: "ClipboardEvent"

    Returns ClipboardEvent

  • Parameters

    • eventInterface: "CloseEvent"

    Returns CloseEvent

  • Parameters

    • eventInterface: "CompositionEvent"

    Returns CompositionEvent

  • Parameters

    • eventInterface: "CustomEvent"

    Returns CustomEvent

  • Parameters

    • eventInterface: "DeviceLightEvent"

    Returns DeviceLightEvent

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

    Returns FocusNavigationEvent

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

    Returns ListeningStateChangedEvent

  • Parameters

    • eventInterface: "MSGestureEvent"

    Returns MSGestureEvent

  • Parameters

    • eventInterface: "MSMediaKeyMessageEvent"

    Returns MSMediaKeyMessageEvent

  • Parameters

    • eventInterface: "MSMediaKeyNeededEvent"

    Returns MSMediaKeyNeededEvent

  • Parameters

    • eventInterface: "MSPointerEvent"

    Returns MSPointerEvent

  • Parameters

    • eventInterface: "MediaEncryptedEvent"

    Returns MediaEncryptedEvent

  • Parameters

    • eventInterface: "MediaKeyMessageEvent"

    Returns MediaKeyMessageEvent

  • Parameters

    • eventInterface: "MediaQueryListEvent"

    Returns MediaQueryListEvent

  • Parameters

    • eventInterface: "MediaStreamErrorEvent"

    Returns MediaStreamErrorEvent

  • Parameters

    • eventInterface: "MediaStreamEvent"

    Returns MediaStreamEvent

  • Parameters

    • eventInterface: "MediaStreamTrackEvent"

    Returns MediaStreamTrackEvent

  • Parameters

    • eventInterface: "MessageEvent"

    Returns MessageEvent

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

    Returns OverflowEvent

  • Parameters

    • eventInterface: "PageTransitionEvent"

    Returns PageTransitionEvent

  • Parameters

    • eventInterface: "PaymentRequestUpdateEvent"

    Returns PaymentRequestUpdateEvent

  • Parameters

    • eventInterface: "PermissionRequestedEvent"

    Returns PermissionRequestedEvent

  • Parameters

    • eventInterface: "PointerEvent"

    Returns PointerEvent

  • Parameters

    • eventInterface: "PopStateEvent"

    Returns PopStateEvent

  • Parameters

    • eventInterface: "ProgressEvent"

    Returns ProgressEvent

  • Parameters

    • eventInterface: "PromiseRejectionEvent"

    Returns PromiseRejectionEvent

  • Parameters

    • eventInterface: "RTCDTMFToneChangeEvent"

    Returns RTCDTMFToneChangeEvent

  • Parameters

    • eventInterface: "RTCDataChannelEvent"

    Returns RTCDataChannelEvent

  • Parameters

    • eventInterface: "RTCDtlsTransportStateChangedEvent"

    Returns RTCDtlsTransportStateChangedEvent

  • Parameters

    • eventInterface: "RTCErrorEvent"

    Returns RTCErrorEvent

  • Parameters

    • eventInterface: "RTCIceCandidatePairChangedEvent"

    Returns RTCIceCandidatePairChangedEvent

  • Parameters

    • eventInterface: "RTCIceGathererEvent"

    Returns RTCIceGathererEvent

  • Parameters

    • eventInterface: "RTCIceTransportStateChangedEvent"

    Returns RTCIceTransportStateChangedEvent

  • Parameters

    • eventInterface: "RTCPeerConnectionIceErrorEvent"

    Returns RTCPeerConnectionIceErrorEvent

  • Parameters

    • eventInterface: "RTCPeerConnectionIceEvent"

    Returns RTCPeerConnectionIceEvent

  • Parameters

    • eventInterface: "RTCSsrcConflictEvent"

    Returns RTCSsrcConflictEvent

  • Parameters

    • eventInterface: "RTCStatsEvent"

    Returns RTCStatsEvent

  • Parameters

    • eventInterface: "RTCTrackEvent"

    Returns RTCTrackEvent

  • Parameters

    • eventInterface: "SVGZoomEvent"

    Returns SVGZoomEvent

  • Parameters

    • eventInterface: "SVGZoomEvents"

    Returns SVGZoomEvent

  • Parameters

    • eventInterface: "SecurityPolicyViolationEvent"

    Returns SecurityPolicyViolationEvent

  • Parameters

    • eventInterface: "ServiceWorkerMessageEvent"

    Returns ServiceWorkerMessageEvent

  • Parameters

    • eventInterface: "SpeechRecognitionEvent"

    Returns SpeechRecognitionEvent

  • Parameters

    • eventInterface: "SpeechSynthesisErrorEvent"

    Returns SpeechSynthesisErrorEvent

  • Parameters

    • eventInterface: "SpeechSynthesisEvent"

    Returns SpeechSynthesisEvent

  • Parameters

    • eventInterface: "StorageEvent"

    Returns StorageEvent

  • Parameters

    • eventInterface: "TextEvent"

    Returns TextEvent

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

    Returns VRDisplayEvent

  • Parameters

    • eventInterface: "VRDisplayEvent "

    Returns VRDisplayEvent

  • Parameters

    • eventInterface: "WebGLContextEvent"

    Returns WebGLContextEvent

  • Parameters

    • eventInterface: "WheelEvent"

    Returns WheelEvent

  • Parameters

    • eventInterface: string

    Returns Event

createExpression

  • createExpression(expression: string, resolver?: XPathNSResolver | null): XPathExpression
  • Parameters

    • expression: string
    • Optional resolver: XPathNSResolver | null

    Returns XPathExpression

createNSResolver

  • createNSResolver(nodeResolver: Node): XPathNSResolver
  • Parameters

    • nodeResolver: Node

    Returns XPathNSResolver

createNodeIterator

  • createNodeIterator(root: Node, whatToShow?: undefined | number, filter?: NodeFilter | null): NodeIterator
  • 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: undefined | number

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

    • Optional filter: NodeFilter | null

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

    Returns NodeIterator

createProcessingInstruction

  • createProcessingInstruction(target: string, data: string): ProcessingInstruction
  • 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.

    Parameters

    • target: string
    • data: string

    Returns ProcessingInstruction

createRange

  • createRange(): Range
  • Returns an empty range object that has both of its boundary points positioned at the beginning of the document.

    Returns Range

createTextNode

  • createTextNode(data: string): Text
  • Creates a text string from the specified value.

    Parameters

    • data: string

      String that specifies the nodeValue property of the text node.

    Returns Text

createTreeWalker

  • createTreeWalker(root: Node, whatToShow?: undefined | number, filter?: NodeFilter | null): TreeWalker
  • createTreeWalker(root: Node, whatToShow: number, filter: NodeFilter | null, entityReferenceExpansion?: undefined | false | true): TreeWalker
  • 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: undefined | number

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

    • Optional filter: NodeFilter | null

      A custom NodeFilter function to use.

    Returns TreeWalker

  • deprecated

    Parameters

    • root: Node
    • whatToShow: number
    • filter: NodeFilter | null
    • Optional entityReferenceExpansion: undefined | false | true

    Returns TreeWalker

dispatchEvent

  • dispatchEvent(event: Event): boolean
  • 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.

    Parameters

    • event: Event

    Returns boolean

elementFromPoint

  • elementFromPoint(x: number, y: number): Element | null
  • 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 Element | null

elementsFromPoint

  • elementsFromPoint(x: number, y: number): Element[]
  • Parameters

    • x: number
    • y: number

    Returns Element[]

evaluate

  • evaluate(expression: string, contextNode: Node, resolver?: XPathNSResolver | null, type?: undefined | number, result?: XPathResult | null): XPathResult
  • Parameters

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

    Returns XPathResult

execCommand

  • execCommand(commandId: string, showUI?: undefined | false | true, value?: undefined | string): 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.

    • Optional showUI: undefined | false | true

      Display the user interface, defaults to false.

    • Optional value: undefined | string

      Value to assign.

    Returns boolean

exitFullscreen

  • exitFullscreen(): Promise<void>
  • Stops document's fullscreen element from being displayed fullscreen and resolves promise when done.

    Returns Promise<void>

exitPointerLock

  • exitPointerLock(): void

getAnimations

  • getAnimations(): Animation[]
  • Returns Animation[]

getElementById

  • getElementById(elementId: string): HTMLElement | null
  • Returns a reference to the first object with the specified value of the ID or NAME attribute.

    Parameters

    • elementId: string

      String that specifies the ID value. Case-insensitive.

    Returns HTMLElement | null

getElementsByClassName

  • getElementsByClassName(classNames: string): HTMLCollectionOf<Element>
  • 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.

    Parameters

    • classNames: string

    Returns HTMLCollectionOf<Element>

getElementsByName

  • getElementsByName(elementName: string): NodeListOf<HTMLElement>
  • 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.

    Returns NodeListOf<HTMLElement>

getElementsByTagName

  • getElementsByTagName<K>(qualifiedName: K): HTMLCollectionOf<HTMLElementTagNameMap[K]>
  • getElementsByTagName<K>(qualifiedName: K): HTMLCollectionOf<SVGElementTagNameMap[K]>
  • getElementsByTagName(qualifiedName: string): HTMLCollectionOf<Element>
  • Retrieves a collection of objects based on the specified element name.

    Type parameters

    • K: keyof HTMLElementTagNameMap

    Parameters

    • qualifiedName: K

    Returns HTMLCollectionOf<HTMLElementTagNameMap[K]>

  • Type parameters

    • K: keyof SVGElementTagNameMap

    Parameters

    • qualifiedName: K

    Returns HTMLCollectionOf<SVGElementTagNameMap[K]>

  • Parameters

    • qualifiedName: string

    Returns HTMLCollectionOf<Element>

getElementsByTagNameNS

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

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

    Returns HTMLCollectionOf<Element>

getRootNode

  • getRootNode(options?: GetRootNodeOptions): Node
  • Returns node's root.

    Parameters

    • Optional options: GetRootNodeOptions

    Returns Node

getSelection

  • getSelection(): Selection | null
  • Returns an object representing the current selection of the document that is loaded into the object displaying a webpage.

    Returns Selection | null

hasChildNodes

  • hasChildNodes(): boolean
  • Returns whether node has children.

    Returns boolean

hasFocus

  • hasFocus(): boolean
  • Gets a value indicating whether the object currently has focus.

    Returns boolean

importNode

  • importNode<T>(importedNode: T, deep: boolean): T
  • 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.

    Type parameters

    • T: Node

    Parameters

    • importedNode: T
    • deep: boolean

    Returns T

insertBefore

  • insertBefore<T>(newChild: T, refChild: Node | null): T
  • Type parameters

    • T: Node

    Parameters

    • newChild: T
    • refChild: Node | null

    Returns T

isDefaultNamespace

  • isDefaultNamespace(namespace: string | null): boolean
  • Parameters

    • namespace: string | null

    Returns boolean

isEqualNode

  • isEqualNode(otherNode: Node | null): boolean
  • Returns whether node and otherNode have the same properties.

    Parameters

    • otherNode: Node | null

    Returns boolean

isSameNode

  • isSameNode(otherNode: Node | null): boolean
  • Parameters

    • otherNode: Node | null

    Returns boolean

lookupNamespaceURI

  • lookupNamespaceURI(prefix: string | null): string | null
  • Parameters

    • prefix: string | null

    Returns string | null

lookupPrefix

  • lookupPrefix(namespace: string | null): string | null
  • Parameters

    • namespace: string | null

    Returns string | null

normalize

  • normalize(): void
  • Removes empty exclusive Text nodes and concatenates the data of remaining contiguous exclusive Text nodes into the first of their nodes.

    Returns void

open

  • open(url?: undefined | string, name?: undefined | string, features?: undefined | string, replace?: undefined | false | true): Document
  • 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 url: undefined | string

      Specifies a MIME type for the document.

    • Optional name: undefined | string

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

    • Optional features: undefined | string

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

    • Optional replace: undefined | false | true

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

    Returns Document

prepend

  • prepend(...nodes: (Node | string)[]): void
  • Inserts nodes before the first child of node, while replacing strings in nodes with equivalent Text nodes.

    Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated.

    Parameters

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

    Returns void

queryCommandEnabled

  • queryCommandEnabled(commandId: string): boolean
  • 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

queryCommandIndeterm

  • queryCommandIndeterm(commandId: string): boolean
  • 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

queryCommandState

  • queryCommandState(commandId: string): boolean
  • Returns a Boolean value that indicates the current state of the command.

    Parameters

    • commandId: string

      String that specifies a command identifier.

    Returns boolean

queryCommandSupported

  • queryCommandSupported(commandId: string): boolean
  • 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

queryCommandValue

  • queryCommandValue(commandId: string): string
  • 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

querySelector

  • querySelector<K>(selectors: K): HTMLElementTagNameMap[K] | null
  • querySelector<K>(selectors: K): SVGElementTagNameMap[K] | null
  • querySelector<E>(selectors: string): E | null
  • Returns the first element that is a descendant of node that matches selectors.

    Type parameters

    • K: keyof HTMLElementTagNameMap

    Parameters

    • selectors: K

    Returns HTMLElementTagNameMap[K] | null

  • Type parameters

    • K: keyof SVGElementTagNameMap

    Parameters

    • selectors: K

    Returns SVGElementTagNameMap[K] | null

  • Type parameters

    • E: Element = Element

    Parameters

    • selectors: string

    Returns E | null

querySelectorAll

  • querySelectorAll<K>(selectors: K): NodeListOf<HTMLElementTagNameMap[K]>
  • querySelectorAll<K>(selectors: K): NodeListOf<SVGElementTagNameMap[K]>
  • querySelectorAll<E>(selectors: string): NodeListOf<E>
  • Returns all element descendants of node that match selectors.

    Type parameters

    • K: keyof HTMLElementTagNameMap

    Parameters

    • selectors: K

    Returns NodeListOf<HTMLElementTagNameMap[K]>

  • Type parameters

    • K: keyof SVGElementTagNameMap

    Parameters

    • selectors: K

    Returns NodeListOf<SVGElementTagNameMap[K]>

  • Type parameters

    • E: Element = Element

    Parameters

    • selectors: string

    Returns NodeListOf<E>

releaseEvents

  • releaseEvents(): void
  • deprecated

    Returns void

removeChild

  • removeChild<T>(oldChild: T): T
  • Type parameters

    • T: Node

    Parameters

    • oldChild: T

    Returns T

removeEventListener

  • removeEventListener<K>(type: K, listener: (this: Document, ev: DocumentEventMap[K]) => any, options?: boolean | EventListenerOptions): void
  • removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void
  • Type parameters

    • K: keyof DocumentEventMap

    Parameters

    • type: K
    • listener: (this: Document, ev: DocumentEventMap[K]) => any
        • (this: Document, ev: DocumentEventMap[K]): any
        • Parameters

          • this: Document
          • ev: DocumentEventMap[K]

          Returns any

    • Optional options: boolean | EventListenerOptions

    Returns void

  • Parameters

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

    Returns void

replaceChild

  • replaceChild<T>(newChild: Node, oldChild: T): T
  • Type parameters

    • T: Node

    Parameters

    • newChild: Node
    • oldChild: T

    Returns T

write

  • write(...text: string[]): void
  • Writes one or more HTML expressions to a document in the specified window.

    Parameters

    • Rest ...text: string[]

    Returns void

writeln

  • writeln(...text: string[]): 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