Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface XMLDocument

Package version

An XML document. It inherits from the generic Document and does not add any specific methods or properties to it: nevertheless, several algorithms behave differently with the two types of documents.

Hierarchy

Index

Properties

Methods

Properties

ATTRIBUTE_NODE

ATTRIBUTE_NODE: number

CDATA_SECTION_NODE

CDATA_SECTION_NODE: number

node is a CDATASection node.

COMMENT_NODE

COMMENT_NODE: number

node is a Comment node.

DOCUMENT_FRAGMENT_NODE

DOCUMENT_FRAGMENT_NODE: number

node is a DocumentFragment node.

DOCUMENT_NODE

DOCUMENT_NODE: number

node is a document.

DOCUMENT_POSITION_CONTAINED_BY

DOCUMENT_POSITION_CONTAINED_BY: number

Set when other is a descendant of node.

DOCUMENT_POSITION_CONTAINS

DOCUMENT_POSITION_CONTAINS: number

Set when other is an ancestor of node.

DOCUMENT_POSITION_DISCONNECTED

DOCUMENT_POSITION_DISCONNECTED: number

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

DOCUMENT_POSITION_FOLLOWING

DOCUMENT_POSITION_FOLLOWING: number

Set when other is following node.

DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC

DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: number

DOCUMENT_POSITION_PRECEDING

DOCUMENT_POSITION_PRECEDING: number

Set when other is preceding node.

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

ELEMENT_NODE

ELEMENT_NODE: number

node is an element.

ENTITY_NODE

ENTITY_NODE: number

ENTITY_REFERENCE_NODE

ENTITY_REFERENCE_NODE: number

NOTATION_NODE

NOTATION_NODE: number

PROCESSING_INSTRUCTION_NODE

PROCESSING_INSTRUCTION_NODE: number

node is a ProcessingInstruction node.

TEXT_NODE

TEXT_NODE: number

node is a Text node.

URL

URL: string

Sets or gets the URL for the current document.

activeElement

activeElement: Element | null

Gets the object that has the focus when the parent document has focus.

alinkColor

alinkColor: string
deprecated

all

deprecated

anchors

deprecated

applets

deprecated

baseURI

baseURI: string

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

bgColor

bgColor: string
deprecated

body

Specifies the beginning and end of the document body.

characterSet

characterSet: string

Returns document's encoding.

charset

charset: string

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

childElementCount

childElementCount: number

childNodes

childNodes: NodeListOf<ChildNode>

Returns the children.

children

children: HTMLCollection

Returns the child elements.

compatMode

compatMode: string

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

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.

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.

defaultView

defaultView: WindowProxy | 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.

doctype

doctype: DocumentType | null

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

documentElement

documentElement: HTMLElement

Gets a reference to the root node of the document.

documentURI

documentURI: string

Returns document's URL.

domain

domain: string

Sets or gets the security domain of the document.

embeds

Retrieves a collection of all embed objects in the document.

fgColor

fgColor: string
deprecated

firstChild

firstChild: ChildNode | null

Returns the first child.

firstElementChild

firstElementChild: Element | null

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

forms

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

fullscreen

fullscreen: boolean
deprecated

fullscreenElement

fullscreenElement: Element | null

Returns document's fullscreen element.

fullscreenEnabled

fullscreenEnabled: boolean

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

head

Returns the head element.

hidden

hidden: boolean

images

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

implementation

implementation: DOMImplementation

Gets the implementation object of the current document.

inputEncoding

inputEncoding: string

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

isConnected

isConnected: boolean

Returns true if node is connected and false otherwise.

lastChild

lastChild: ChildNode | null

Returns the last child.

lastElementChild

lastElementChild: Element | null

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

lastModified

lastModified: string

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

linkColor

linkColor: string
deprecated

links

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.

namespaceURI

namespaceURI: string | null
deprecated

nextSibling

nextSibling: ChildNode | null

Returns the next sibling.

nodeName

nodeName: string

Returns a string appropriate for the type of node.

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

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.

onloadend

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

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: ProgressEvent<Document>) => 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

ontouchcancel

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

ontouchend

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

ontouchmove

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

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

origin

origin: string

Returns document's origin.

ownerDocument

ownerDocument: Document | null

Returns the node document. Returns null for documents.

parentElement

parentElement: HTMLElement | null

Returns the parent element.

parentNode

parentNode: (Node & ParentNode) | null

Returns the parent.

plugins

Return an HTMLCollection of the embed elements in the Document.

pointerLockElement

pointerLockElement: Element | null

previousSibling

previousSibling: Node | null

Returns the previous sibling.

readyState

readyState: DocumentReadyState

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

referrer

referrer: string

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

scripts

Retrieves a collection of all script objects in the document.

scrollingElement

scrollingElement: Element | null

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

timeline

title

title: string

Contains the title of the document.

visibilityState

visibilityState: VisibilityState

vlinkColor

vlinkColor: string
deprecated

Methods

addEventListener

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

    Parameters

    • source: T

    Returns T

append

  • append(...nodes: (string | Node)[]): 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: (string | Node)[]

    Returns void

appendChild

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

    Parameters

    • newChild: T

    Returns T

captureEvents

  • captureEvents(): void
  • deprecated

    Returns void

caretPositionFromPoint

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

caretRangeFromPoint

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

    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

  • 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

createElement

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

    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

    Returns Element

  • Parameters

    Returns Element

createEvent

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

    Returns SpeechRecognitionError

  • 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

createNSResolver

  • Parameters

    • nodeResolver: Node

    Returns XPathNSResolver

createNodeIterator

  • 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

  • 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

  • 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

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

evaluate

  • 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

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

    Returns Promise<void>

exitPointerLock

  • exitPointerLock(): void
  • Returns void

getAnimations

  • 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

  • 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

  • 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

getElementsByTagNameNS

  • 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

  • Returns node's root.

    Parameters

    Returns Node

getSelection

  • 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

    Parameters

    • importedNode: T
    • deep: boolean

    Returns T

insertBefore

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

    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: (string | Node)[]): 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: (string | Node)[]

    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

    Parameters

    • selectors: K

    Returns HTMLElementTagNameMap[K] | null

  • Type parameters

    Parameters

    • selectors: K

    Returns SVGElementTagNameMap[K] | null

  • Type parameters

    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

    Parameters

    • selectors: K

    Returns NodeListOf<HTMLElementTagNameMap[K]>

  • Type parameters

    Parameters

    • selectors: K

    Returns NodeListOf<SVGElementTagNameMap[K]>

  • Type parameters

    Parameters

    • selectors: string

    Returns NodeListOf<E>

releaseEvents

  • releaseEvents(): void
  • deprecated

    Returns void

removeChild

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

    Parameters

    • oldChild: T

    Returns T

removeEventListener

replaceChild

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

    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

Generated using TypeDoc