Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface XMLDocument

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

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

deprecated

Readonly anchors

deprecated

Readonly applets

deprecated

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

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: (Window & 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

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

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

Returns the head element.

Readonly hidden

hidden: boolean

Readonly images

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

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

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

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

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

title

title: string

Contains the title of the document.

Readonly 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?: boolean): Node
  • Returns a copy of node. If deep is true, the copy also includes the node's descendants.

    Parameters

    • Optional deep: boolean

    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

createExpression

createNSResolver

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

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

    Parameters

    • root: Node

      The root element or node to start traversing on.

    • Optional whatToShow: number

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

    • Optional filter: NodeFilter | null

      A custom NodeFilter function to use.

    Returns TreeWalker

  • deprecated

    Parameters

    • root: Node
    • whatToShow: number
    • filter: NodeFilter | null
    • Optional entityReferenceExpansion: boolean

    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

elementsFromPoint

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

evaluate

execCommand

  • execCommand(commandId: string, showUI?: boolean, value?: 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: boolean

      Display the user interface, defaults to false.

    • Optional value: 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

getAnimations

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

getSelection

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?: string, name?: string, features?: string, replace?: boolean): 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: string

      Specifies a MIME type for the document.

    • Optional name: 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: 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: boolean

      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>

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