Document interface
The Document interface represents any web page loaded in the browser and serves as an entry point into the web page's content, which is the DOM tree.
- Extends
-
Node,DocumentOrShadowRoot,FontFaceSource,GlobalEventHandlers,NonElementParentNode,ParentNode,XPathEvaluatorBase
Properties
| alink |
Returns or sets the color of an active link in the document body. |
| all | The Document interface's read-only |
| anchors | The |
| applets | The |
| bg |
The deprecated |
| body | The |
| character |
The |
| charset | |
| compat |
The |
| content |
The |
| cookie | The Document property |
| current |
The |
| default |
In browsers, |
| design |
|
| dir | The |
| doctype | The |
| document |
The |
| documentURI | The |
| domain | The |
| embeds | The |
| fg |
|
| forms | The |
| fragment |
The |
| fullscreen | The obsolete Document interface's |
| fullscreen |
The read-only |
| head | The |
| hidden | The |
| images | The |
| implementation | The |
| input |
|
| last |
The |
| link |
The |
| links | The |
| location | The |
| moz |
|
| ms |
|
| onfullscreenchange | |
| onfullscreenerror | |
| onpointerlockchange | |
| onpointerlockerror | |
| onreadystatechange | |
| onvisibilitychange | |
| owner |
The read-only |
| picture |
The read-only |
| plugins | The |
| ready |
The |
| referrer | The |
| root |
|
| scripts | The |
| scrolling |
The |
| text |
|
| timeline | The |
| title | The |
| URL | The |
| visibility |
The |
| vlink |
The |
| webkit |
Inherited Properties
| active |
Returns the deepest element in the document through which or to which key events are being routed. This is, roughly speaking, the focused element in the document. For the purposes of this API, when a child browsing context is focused, its container is focused in the parent browsing context. For example, if the user moves the focus to a text control in an iframe, the iframe is the element returned by the activeElement API in the iframe's node document. Similarly, when the focused element is in a different node tree than documentOrShadowRoot, the element returned will be the host that's located in the same node tree as documentOrShadowRoot if documentOrShadowRoot is a shadow-including inclusive ancestor of the focused element, and null if not. |
| adopted |
|
| ATTRIBUTE_NODE | |
| baseURI | The read-only |
| CDATA_SECTION_NODE | node is a CDATASection node. |
| child |
|
| child |
The read-only |
| children | Returns the child elements. |
| COMMENT_NODE | node is a Comment node. |
| DOCUMENT_FRAGMENT_NODE | node is a DocumentFragment node. |
| DOCUMENT_NODE | node is a document. |
| DOCUMENT_POSITION_CONTAINED_BY | Set when other is a descendant of node. |
| DOCUMENT_POSITION_CONTAINS | Set when other is an ancestor of node. |
| DOCUMENT_POSITION_DISCONNECTED | Set when node and other are not in the same tree. |
| DOCUMENT_POSITION_FOLLOWING | Set when other is following node. |
| DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC | |
| DOCUMENT_POSITION_PRECEDING | Set when other is preceding node. |
| DOCUMENT_TYPE_NODE | node is a doctype. |
| ELEMENT_NODE | node is an element. |
| ENTITY_NODE | |
| ENTITY_REFERENCE_NODE | |
| first |
The read-only |
| first |
Returns the first child that is an element, and null otherwise. |
| fonts | |
| fullscreen |
Returns document's fullscreen element. |
| is |
The read-only |
| last |
The read-only |
| last |
Returns the last child that is an element, and null otherwise. |
| next |
The read-only |
| node |
The read-only |
| node |
The read-only |
| node |
The |
| NOTATION_NODE | |
| onabort | |
| onanimationcancel | |
| onanimationend | |
| onanimationiteration | |
| onanimationstart | |
| onauxclick | |
| onbeforeinput | |
| onbeforematch | |
| onbeforetoggle | |
| onblur | |
| oncancel | |
| oncanplay | |
| oncanplaythrough | |
| onchange | |
| onclick | |
| onclose | |
| oncontextlost | |
| oncontextmenu | |
| oncontextrestored | |
| oncopy | |
| oncuechange | |
| oncut | |
| ondblclick | |
| ondrag | |
| ondragend | |
| ondragenter | |
| ondragleave | |
| ondragover | |
| ondragstart | |
| ondrop | |
| ondurationchange | |
| onemptied | |
| onended | |
| onerror | |
| onfocus | |
| onformdata | |
| ongotpointercapture | |
| oninput | |
| oninvalid | |
| onkeydown | |
| onkeypress | |
| onkeyup | |
| onload | |
| onloadeddata | |
| onloadedmetadata | |
| onloadstart | |
| onlostpointercapture | |
| onmousedown | |
| onmouseenter | |
| onmouseleave | |
| onmousemove | |
| onmouseout | |
| onmouseover | |
| onmouseup | |
| onpaste | |
| onpause | |
| onplay | |
| onplaying | |
| onpointercancel | |
| onpointerdown | |
| onpointerenter | |
| onpointerleave | |
| onpointermove | |
| onpointerout | |
| onpointerover | |
| onpointerrawupdate | Available only in secure contexts. |
| onpointerup | |
| onprogress | |
| onratechange | |
| onreset | |
| onresize | |
| onscroll | |
| onscrollend | |
| onsecuritypolicyviolation | |
| onseeked | |
| onseeking | |
| onselect | |
| onselectionchange | |
| onselectstart | |
| onslotchange | |
| onstalled | |
| onsubmit | |
| onsuspend | |
| ontimeupdate | |
| ontoggle | |
| ontouchcancel | |
| ontouchend | |
| ontouchmove | |
| ontouchstart | |
| ontransitioncancel | |
| ontransitionend | |
| ontransitionrun | |
| ontransitionstart | |
| onvolumechange | |
| onwaiting | |
| onwebkitanimationend | |
| onwebkitanimationiteration | |
| onwebkitanimationstart | |
| onwebkittransitionend | |
| onwheel | |
| parent |
The read-only |
| parent |
The read-only |
| picture |
|
| pointer |
|
| previous |
The read-only |
| PROCESSING_INSTRUCTION_NODE | node is a ProcessingInstruction node. |
| style |
|
| TEXT_NODE | node is a Text node. |
Methods
| add |
|
| add |
The |
| adopt |
|
| capture |
|
| caret |
The |
| caret |
|
| clear() | The |
| close() | The |
| create |
The |
| create |
The |
| create |
|
| create |
|
| create |
Creates a new empty DocumentFragment into which DOM nodes can be added to build an offscreen DOM tree. |
| create |
|
| create |
In an HTML document, the |
| create |
|
| create |
|
| create |
Creates an element with the specified namespace URI and qualified name. |
| create |
|
| create |
|
| create |
|
| create |
|
| create |
|
| create |
Creates an event of the type specified. |
| create |
|
| create |
|
| create |
|
| create |
|
| create |
|
| create |
|
| create |
|
| create |
|
| create |
|
| create |
|
| create |
|
| create |
|
| create |
|
| create |
|
| create |
|
| create |
|
| create |
|
| create |
|
| create |
|
| create |
|
| create |
|
| create |
|
| create |
|
| create |
|
| create |
|
| create |
|
| create |
|
| create |
|
| create |
|
| create |
|
| create |
|
| create |
|
| create |
|
| create |
|
| create |
|
| create |
|
| create |
|
| create |
|
| create |
|
| create |
|
| create |
|
| create |
|
| create |
|
| create |
|
| create |
|
| create |
|
| create |
|
| create |
|
| create |
|
| create |
|
| create |
|
| create |
|
| create |
|
| create |
|
| create |
|
| create |
|
| create |
|
| create |
|
| create |
|
| create |
|
| create |
|
| create |
|
| create |
|
| create |
|
| create |
|
| create |
The |
| create |
|
| create |
The |
| create |
Creates a new Text node. |
| create |
The |
| exec |
The |
| exit |
The Document method |
| exit |
The |
| exit |
The |
| get |
Returns the first element within node's descendants whose ID is elementId. |
| get |
The |
| get |
The |
| get |
|
| get |
The |
| get |
|
| get |
|
| get |
|
| get |
|
| get |
Returns a list of elements with the given tag name belonging to the given namespace. |
| get |
|
| get |
|
| get |
The |
| has |
The |
| has |
The |
| import |
The Document object's |
| open(string | URL, string, string) | |
| open(string, string) | The |
| query |
The |
| query |
|
| query |
The |
| query |
The |
| query |
|
| release |
|
| remove |
|
| remove |
The |
| request |
The |
| start |
The |
| write(string[]) | The |
| writeln(string[]) | The |
Inherited Methods
| append((string | Node)[]) | 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. |
| append |
The |
| clone |
The |
| compare |
The |
| contains(Node | null) | The |
| create |
|
| create |
|
| dispatch |
The |
| element |
|
| elements |
|
| evaluate(string, Node, XPath |
|
| get |
|
| get |
The |
| has |
The |
| insert |
The |
| is |
The |
| is |
The |
| is |
The |
| lookup |
The |
| lookup |
The |
| normalize() | The |
| prepend((string | Node)[]) | 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. |
| query |
|
| query |
Returns the first element that is a descendant of node that matches selectors. |
| query |
|
| query |
|
| query |
|
| query |
|
| query |
Returns all element descendants of node that match selectors. |
| query |
|
| query |
|
| query |
|
| remove |
The |
| replace |
The |
| replace |
Replace all children of node with nodes, while replacing strings in nodes with equivalent Text nodes. Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. |
Property Details
alinkColor
Returns or sets the color of an active link in the document body.
alinkColor: string
Property Value
string
all
The Document interface's read-only all property returns an HTMLAllCollection rooted at the document node.
all: HTMLAllCollection
Property Value
HTMLAllCollection
anchors
The anchors read-only property of the An HTMLCollection.
anchors: HTMLCollectionOf<HTMLAnchorElement>
Property Value
HTMLCollectionOf<HTMLAnchorElement>
applets
The applets property of the Document returns an empty HTMLCollection.
applets: HTMLCollection
Property Value
HTMLCollection
bgColor
The deprecated bgColor property gets or sets the background color of the current document.
bgColor: string
Property Value
string
body
The Document.body property represents the null if no such element exists.
body: HTMLElement
Property Value
HTMLElement
characterSet
The Document.characterSet read-only property returns the character encoding of the document that it's currently rendered with.
characterSet: string
Property Value
string
charset
charset: string
Property Value
string
compatMode
The Document.compatMode read-only property indicates whether the document is rendered in Quirks mode or Standards mode.
compatMode: string
Property Value
string
contentType
The Document.contentType read-only property returns the MIME type that the document is being rendered as.
contentType: string
Property Value
string
cookie
The Document property cookie lets you read and write cookies associated with the document.
cookie: string
Property Value
string
currentScript
The Document.currentScript property returns the script element whose script is currently being processed and isn't a JavaScript module.
currentScript: HTMLOrSVGScriptElement | null
Property Value
HTMLOrSVGScriptElement | null
defaultView
In browsers, document.defaultView returns the This property is read-only.
defaultView: (Window & typeof globalThis) | null
Property Value
(Window & typeof globalThis) | null
designMode
document.designMode controls whether the entire document is editable.
designMode: string
Property Value
string
dir
The Document.dir property is a string representing the directionality of the text of the document, whether left to right (default) or right to left.
dir: string
Property Value
string
doctype
The doctype read-only property of the Document interface is a DocumentType object representing the Doctype associated with the current document.
doctype: DocumentType | null
Property Value
DocumentType | null
documentElement
The documentElement read-only property of the Document interface returns the example, the html element for HTML documents).
documentElement: HTMLElement
Property Value
HTMLElement
documentURI
The documentURI read-only property of the A string.
documentURI: string
Property Value
string
domain
The domain property of the Document interface gets/sets the domain portion of the origin of the current document, as used by the same-origin policy.
domain: string
Property Value
string
embeds
The embeds read-only property of the An HTMLCollection.
embeds: HTMLCollectionOf<HTMLEmbedElement>
Property Value
HTMLCollectionOf<HTMLEmbedElement>
fgColor
fgColor gets/sets the foreground color, or text color, of the current document.
fgColor: string
Property Value
string
forms
The forms read-only property of the Document interface returns an HTMLCollection listing all the form elements contained in the document.
forms: HTMLCollectionOf<HTMLFormElement>
Property Value
HTMLCollectionOf<HTMLFormElement>
fragmentDirective
The fragmentDirective read-only property of the Document interface returns the FragmentDirective for the current document.
fragmentDirective: FragmentDirective
Property Value
FragmentDirective
fullscreen
The obsolete Document interface's fullscreen read-only property reports whether or not the document is currently displaying content in fullscreen mode.
fullscreen: boolean
Property Value
boolean
fullscreenEnabled
The read-only fullscreenEnabled property on the Document interface indicates whether or not fullscreen mode is available.
fullscreenEnabled: boolean
Property Value
boolean
head
The head read-only property of the Document interface returns the head element of the current document.
head: HTMLHeadElement
Property Value
HTMLHeadElement
hidden
The Document.hidden read-only property returns a Boolean value indicating if the page is considered hidden or not.
hidden: boolean
Property Value
boolean
images
The images read-only property of the Document interface returns a collection of the images in the current HTML document.
images: HTMLCollectionOf<HTMLImageElement>
Property Value
HTMLCollectionOf<HTMLImageElement>
implementation
The Document.implementation property returns a A DOMImplementation object.
implementation: DOMImplementation
Property Value
DOMImplementation
inputEncoding
inputEncoding: string
Property Value
string
lastModified
The lastModified property of the Document interface returns a string containing the date and local time on which the current document was last modified.
lastModified: string
Property Value
string
linkColor
The Document.linkColor property gets/sets the color of links within the document.
linkColor: string
Property Value
string
links
The links read-only property of the Document interface returns a collection of all area elements and a elements in a document with a value for the href attribute.
links: HTMLCollectionOf<HTMLAnchorElement | HTMLAreaElement>
Property Value
HTMLCollectionOf<HTMLAnchorElement | HTMLAreaElement>
location
The Document.location read-only property returns a and provides methods for changing that URL and loading another URL.
Location location
Property Value
Location
mozCancelFullScreen
mozCancelFullScreen: any
Property Value
any
msExitFullscreen
msExitFullscreen: any
Property Value
any
onfullscreenchange
onfullscreenchange: (this: Document, ev: Event) => any | null
Property Value
(this: Document, ev: Event) => any | null
onfullscreenerror
onfullscreenerror: (this: Document, ev: Event) => any | null
Property Value
(this: Document, ev: Event) => any | null
onpointerlockchange
onpointerlockchange: (this: Document, ev: Event) => any | null
Property Value
(this: Document, ev: Event) => any | null
onpointerlockerror
onpointerlockerror: (this: Document, ev: Event) => any | null
Property Value
(this: Document, ev: Event) => any | null
onreadystatechange
onreadystatechange: (this: Document, ev: Event) => any | null
Property Value
(this: Document, ev: Event) => any | null
onvisibilitychange
onvisibilitychange: (this: Document, ev: Event) => any | null
Property Value
(this: Document, ev: Event) => any | null
ownerDocument
The read-only ownerDocument property of the Node interface returns the top-level document object of the node.
ownerDocument: null
Property Value
null
pictureInPictureEnabled
The read-only pictureInPictureEnabled property of the available.
pictureInPictureEnabled: boolean
Property Value
boolean
plugins
The plugins read-only property of the containing one or more HTMLEmbedElements representing the An HTMLCollection.
plugins: HTMLCollectionOf<HTMLEmbedElement>
Property Value
HTMLCollectionOf<HTMLEmbedElement>
readyState
The Document.readyState property describes the loading state of the document.
readyState: DocumentReadyState
Property Value
DocumentReadyState
referrer
The Document.referrer property returns the URI of the page that linked to this page.
referrer: string
Property Value
string
rootElement
Document.rootElement returns the Element that is the root element of the document if it is an documents.
rootElement: SVGSVGElement | null
Property Value
SVGSVGElement | null
scripts
The scripts property of the Document interface returns a list of the script elements in the document.
scripts: HTMLCollectionOf<HTMLScriptElement>
Property Value
HTMLCollectionOf<HTMLScriptElement>
scrollingElement
The scrollingElement read-only property of the scrolls the document.
scrollingElement: Element | null
Property Value
Element | null
textContent
timeline
The timeline readonly property of the Document interface represents the default timeline of the current document.
timeline: DocumentTimeline
Property Value
DocumentTimeline
title
The document.title property gets or sets the current title of the document.
title: string
Property Value
string
URL
The URL read-only property of the Document interface returns the document location as a string.
URL: string
Property Value
string
visibilityState
The Document.visibilityState read-only property returns the visibility of the document.
visibilityState: DocumentVisibilityState
Property Value
DocumentVisibilityState
vlinkColor
The Document.vlinkColor property gets/sets the color of links that the user has visited in the document.
vlinkColor: string
Property Value
string
webkitExitFullscreen
webkitExitFullscreen: void
Property Value
void
Inherited Property Details
activeElement
Returns the deepest element in the document through which or to which key events are being routed. This is, roughly speaking, the focused element in the document.
For the purposes of this API, when a child browsing context is focused, its container is focused in the parent browsing context. For example, if the user moves the focus to a text control in an iframe, the iframe is the element returned by the activeElement API in the iframe's node document.
Similarly, when the focused element is in a different node tree than documentOrShadowRoot, the element returned will be the host that's located in the same node tree as documentOrShadowRoot if documentOrShadowRoot is a shadow-including inclusive ancestor of the focused element, and null if not.
activeElement: Element | null
Property Value
Element | null
Inherited From DocumentOrShadowRoot.activeElement
adoptedStyleSheets
adoptedStyleSheets: CSSStyleSheet[]
Property Value
CSSStyleSheet[]
Inherited From DocumentOrShadowRoot.adoptedStyleSheets
ATTRIBUTE_NODE
ATTRIBUTE_NODE: 2
Property Value
2
Inherited From Node.ATTRIBUTE_NODE
baseURI
The read-only baseURI property of the Node interface returns the absolute base URL of the document containing the node.
baseURI: string
Property Value
string
Inherited From Node.baseURI
CDATA_SECTION_NODE
node is a CDATASection node.
CDATA_SECTION_NODE: 4
Property Value
4
Inherited From Node.CDATA_SECTION_NODE
childElementCount
childElementCount: number
Property Value
number
Inherited From ParentNode.childElementCount
childNodes
The read-only childNodes property of the Node interface returns a live the first child node is assigned index 0.
childNodes: NodeListOf<ChildNode>
Property Value
NodeListOf<ChildNode>
Inherited From Node.childNodes
children
Returns the child elements.
children: HTMLCollection
Property Value
HTMLCollection
Inherited From ParentNode.children
COMMENT_NODE
node is a Comment node.
COMMENT_NODE: 8
Property Value
8
Inherited From Node.COMMENT_NODE
DOCUMENT_FRAGMENT_NODE
node is a DocumentFragment node.
DOCUMENT_FRAGMENT_NODE: 11
Property Value
11
Inherited From Node.DOCUMENT_FRAGMENT_NODE
DOCUMENT_NODE
node is a document.
DOCUMENT_NODE: 9
Property Value
9
Inherited From Node.DOCUMENT_NODE
DOCUMENT_POSITION_CONTAINED_BY
Set when other is a descendant of node.
DOCUMENT_POSITION_CONTAINED_BY: 16
Property Value
16
Inherited From Node.DOCUMENT_POSITION_CONTAINED_BY
DOCUMENT_POSITION_CONTAINS
Set when other is an ancestor of node.
DOCUMENT_POSITION_CONTAINS: 8
Property Value
8
Inherited From Node.DOCUMENT_POSITION_CONTAINS
DOCUMENT_POSITION_DISCONNECTED
Set when node and other are not in the same tree.
DOCUMENT_POSITION_DISCONNECTED: 1
Property Value
1
Inherited From Node.DOCUMENT_POSITION_DISCONNECTED
DOCUMENT_POSITION_FOLLOWING
Set when other is following node.
DOCUMENT_POSITION_FOLLOWING: 4
Property Value
4
Inherited From Node.DOCUMENT_POSITION_FOLLOWING
DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC
DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: 32
Property Value
32
Inherited From Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC
DOCUMENT_POSITION_PRECEDING
Set when other is preceding node.
DOCUMENT_POSITION_PRECEDING: 2
Property Value
2
Inherited From Node.DOCUMENT_POSITION_PRECEDING
DOCUMENT_TYPE_NODE
node is a doctype.
DOCUMENT_TYPE_NODE: 10
Property Value
10
Inherited From Node.DOCUMENT_TYPE_NODE
ELEMENT_NODE
node is an element.
ELEMENT_NODE: 1
Property Value
1
Inherited From Node.ELEMENT_NODE
ENTITY_NODE
ENTITY_NODE: 6
Property Value
6
Inherited From Node.ENTITY_NODE
ENTITY_REFERENCE_NODE
ENTITY_REFERENCE_NODE: 5
Property Value
5
Inherited From Node.ENTITY_REFERENCE_NODE
firstChild
The read-only firstChild property of the Node interface returns the node's first child in the tree, or null if the node has no children.
firstChild: ChildNode | null
Property Value
ChildNode | null
Inherited From Node.firstChild
firstElementChild
Returns the first child that is an element, and null otherwise.
firstElementChild: Element | null
Property Value
Element | null
Inherited From ParentNode.firstElementChild
fonts
fullscreenElement
Returns document's fullscreen element.
fullscreenElement: Element | null
Property Value
Element | null
Inherited From DocumentOrShadowRoot.fullscreenElement
isConnected
The read-only isConnected property of the Node interface returns a boolean indicating whether the node is connected (directly or indirectly) to a Document object.
isConnected: boolean
Property Value
boolean
Inherited From Node.isConnected
lastChild
The read-only lastChild property of the Node interface returns the last child of the node, or null if there are no child nodes.
lastChild: ChildNode | null
Property Value
ChildNode | null
Inherited From Node.lastChild
lastElementChild
Returns the last child that is an element, and null otherwise.
lastElementChild: Element | null
Property Value
Element | null
Inherited From ParentNode.lastElementChild
nextSibling
The read-only nextSibling property of the Node interface returns the node immediately following the specified one in their parent's Node.childNodes, or returns null if the specified node is the last child in the parent element.
nextSibling: ChildNode | null
Property Value
ChildNode | null
Inherited From Node.nextSibling
nodeName
The read-only nodeName property of Node returns the name of the current node as a string.
nodeName: string
Property Value
string
Inherited From Node.nodeName
nodeType
The read-only nodeType property of a Node interface is an integer that identifies what the node is.
nodeType: number
Property Value
number
Inherited From Node.nodeType
nodeValue
The nodeValue property of the Node interface returns or sets the value of the current node.
nodeValue: string | null
Property Value
string | null
Inherited From Node.nodeValue
NOTATION_NODE
NOTATION_NODE: 12
Property Value
12
Inherited From Node.NOTATION_NODE
onabort
onabort: (this: GlobalEventHandlers, ev: UIEvent) => any | null
Property Value
(this: GlobalEventHandlers, ev: UIEvent) => any | null
Inherited From GlobalEventHandlers.onabort
onanimationcancel
onanimationcancel: (this: GlobalEventHandlers, ev: AnimationEvent) => any | null
Property Value
(this: GlobalEventHandlers, ev: AnimationEvent) => any | null
Inherited From GlobalEventHandlers.onanimationcancel
onanimationend
onanimationend: (this: GlobalEventHandlers, ev: AnimationEvent) => any | null
Property Value
(this: GlobalEventHandlers, ev: AnimationEvent) => any | null
Inherited From GlobalEventHandlers.onanimationend
onanimationiteration
onanimationiteration: (this: GlobalEventHandlers, ev: AnimationEvent) => any | null
Property Value
(this: GlobalEventHandlers, ev: AnimationEvent) => any | null
Inherited From GlobalEventHandlers.onanimationiteration
onanimationstart
onanimationstart: (this: GlobalEventHandlers, ev: AnimationEvent) => any | null
Property Value
(this: GlobalEventHandlers, ev: AnimationEvent) => any | null
Inherited From GlobalEventHandlers.onanimationstart
onauxclick
onauxclick: (this: GlobalEventHandlers, ev: PointerEvent) => any | null
Property Value
(this: GlobalEventHandlers, ev: PointerEvent) => any | null
Inherited From GlobalEventHandlers.onauxclick
onbeforeinput
onbeforeinput: (this: GlobalEventHandlers, ev: InputEvent) => any | null
Property Value
(this: GlobalEventHandlers, ev: InputEvent) => any | null
Inherited From GlobalEventHandlers.onbeforeinput
onbeforematch
onbeforematch: (this: GlobalEventHandlers, ev: Event) => any | null
Property Value
(this: GlobalEventHandlers, ev: Event) => any | null
Inherited From GlobalEventHandlers.onbeforematch
onbeforetoggle
onbeforetoggle: (this: GlobalEventHandlers, ev: ToggleEvent) => any | null
Property Value
(this: GlobalEventHandlers, ev: ToggleEvent) => any | null
Inherited From GlobalEventHandlers.onbeforetoggle
onblur
onblur: (this: GlobalEventHandlers, ev: FocusEvent) => any | null
Property Value
(this: GlobalEventHandlers, ev: FocusEvent) => any | null
Inherited From GlobalEventHandlers.onblur
oncancel
oncancel: (this: GlobalEventHandlers, ev: Event) => any | null
Property Value
(this: GlobalEventHandlers, ev: Event) => any | null
Inherited From GlobalEventHandlers.oncancel
oncanplay
oncanplay: (this: GlobalEventHandlers, ev: Event) => any | null
Property Value
(this: GlobalEventHandlers, ev: Event) => any | null
Inherited From GlobalEventHandlers.oncanplay
oncanplaythrough
oncanplaythrough: (this: GlobalEventHandlers, ev: Event) => any | null
Property Value
(this: GlobalEventHandlers, ev: Event) => any | null
Inherited From GlobalEventHandlers.oncanplaythrough
onchange
onchange: (this: GlobalEventHandlers, ev: Event) => any | null
Property Value
(this: GlobalEventHandlers, ev: Event) => any | null
Inherited From GlobalEventHandlers.onchange
onclick
onclick: (this: GlobalEventHandlers, ev: PointerEvent) => any | null
Property Value
(this: GlobalEventHandlers, ev: PointerEvent) => any | null
Inherited From GlobalEventHandlers.onclick
onclose
onclose: (this: GlobalEventHandlers, ev: Event) => any | null
Property Value
(this: GlobalEventHandlers, ev: Event) => any | null
Inherited From GlobalEventHandlers.onclose
oncontextlost
oncontextlost: (this: GlobalEventHandlers, ev: Event) => any | null
Property Value
(this: GlobalEventHandlers, ev: Event) => any | null
Inherited From GlobalEventHandlers.oncontextlost
oncontextmenu
oncontextmenu: (this: GlobalEventHandlers, ev: PointerEvent) => any | null
Property Value
(this: GlobalEventHandlers, ev: PointerEvent) => any | null
Inherited From GlobalEventHandlers.oncontextmenu
oncontextrestored
oncontextrestored: (this: GlobalEventHandlers, ev: Event) => any | null
Property Value
(this: GlobalEventHandlers, ev: Event) => any | null
Inherited From GlobalEventHandlers.oncontextrestored
oncopy
oncopy: (this: GlobalEventHandlers, ev: ClipboardEvent) => any | null
Property Value
(this: GlobalEventHandlers, ev: ClipboardEvent) => any | null
Inherited From GlobalEventHandlers.oncopy
oncuechange
oncuechange: (this: GlobalEventHandlers, ev: Event) => any | null
Property Value
(this: GlobalEventHandlers, ev: Event) => any | null
Inherited From GlobalEventHandlers.oncuechange
oncut
oncut: (this: GlobalEventHandlers, ev: ClipboardEvent) => any | null
Property Value
(this: GlobalEventHandlers, ev: ClipboardEvent) => any | null
Inherited From GlobalEventHandlers.oncut
ondblclick
ondblclick: (this: GlobalEventHandlers, ev: MouseEvent) => any | null
Property Value
(this: GlobalEventHandlers, ev: MouseEvent) => any | null
Inherited From GlobalEventHandlers.ondblclick
ondrag
ondrag: (this: GlobalEventHandlers, ev: DragEvent) => any | null
Property Value
(this: GlobalEventHandlers, ev: DragEvent) => any | null
Inherited From GlobalEventHandlers.ondrag
ondragend
ondragend: (this: GlobalEventHandlers, ev: DragEvent) => any | null
Property Value
(this: GlobalEventHandlers, ev: DragEvent) => any | null
Inherited From GlobalEventHandlers.ondragend
ondragenter
ondragenter: (this: GlobalEventHandlers, ev: DragEvent) => any | null
Property Value
(this: GlobalEventHandlers, ev: DragEvent) => any | null
Inherited From GlobalEventHandlers.ondragenter
ondragleave
ondragleave: (this: GlobalEventHandlers, ev: DragEvent) => any | null
Property Value
(this: GlobalEventHandlers, ev: DragEvent) => any | null
Inherited From GlobalEventHandlers.ondragleave
ondragover
ondragover: (this: GlobalEventHandlers, ev: DragEvent) => any | null
Property Value
(this: GlobalEventHandlers, ev: DragEvent) => any | null
Inherited From GlobalEventHandlers.ondragover
ondragstart
ondragstart: (this: GlobalEventHandlers, ev: DragEvent) => any | null
Property Value
(this: GlobalEventHandlers, ev: DragEvent) => any | null
Inherited From GlobalEventHandlers.ondragstart
ondrop
ondrop: (this: GlobalEventHandlers, ev: DragEvent) => any | null
Property Value
(this: GlobalEventHandlers, ev: DragEvent) => any | null
Inherited From GlobalEventHandlers.ondrop
ondurationchange
ondurationchange: (this: GlobalEventHandlers, ev: Event) => any | null
Property Value
(this: GlobalEventHandlers, ev: Event) => any | null
Inherited From GlobalEventHandlers.ondurationchange
onemptied
onemptied: (this: GlobalEventHandlers, ev: Event) => any | null
Property Value
(this: GlobalEventHandlers, ev: Event) => any | null
Inherited From GlobalEventHandlers.onemptied
onended
onended: (this: GlobalEventHandlers, ev: Event) => any | null
Property Value
(this: GlobalEventHandlers, ev: Event) => any | null
Inherited From GlobalEventHandlers.onended
onerror
onerror: OnErrorEventHandler
Property Value
OnErrorEventHandler
Inherited From GlobalEventHandlers.onerror
onfocus
onfocus: (this: GlobalEventHandlers, ev: FocusEvent) => any | null
Property Value
(this: GlobalEventHandlers, ev: FocusEvent) => any | null
Inherited From GlobalEventHandlers.onfocus
onformdata
onformdata: (this: GlobalEventHandlers, ev: FormDataEvent) => any | null
Property Value
(this: GlobalEventHandlers, ev: FormDataEvent) => any | null
Inherited From GlobalEventHandlers.onformdata
ongotpointercapture
ongotpointercapture: (this: GlobalEventHandlers, ev: PointerEvent) => any | null
Property Value
(this: GlobalEventHandlers, ev: PointerEvent) => any | null
Inherited From GlobalEventHandlers.ongotpointercapture
oninput
oninput: (this: GlobalEventHandlers, ev: Event) => any | null
Property Value
(this: GlobalEventHandlers, ev: Event) => any | null
Inherited From GlobalEventHandlers.oninput
oninvalid
oninvalid: (this: GlobalEventHandlers, ev: Event) => any | null
Property Value
(this: GlobalEventHandlers, ev: Event) => any | null
Inherited From GlobalEventHandlers.oninvalid
onkeydown
onkeydown: (this: GlobalEventHandlers, ev: KeyboardEvent) => any | null
Property Value
(this: GlobalEventHandlers, ev: KeyboardEvent) => any | null
Inherited From GlobalEventHandlers.onkeydown
onkeypress
onkeypress: (this: GlobalEventHandlers, ev: KeyboardEvent) => any | null
Property Value
(this: GlobalEventHandlers, ev: KeyboardEvent) => any | null
Inherited From GlobalEventHandlers.onkeypress
onkeyup
onkeyup: (this: GlobalEventHandlers, ev: KeyboardEvent) => any | null
Property Value
(this: GlobalEventHandlers, ev: KeyboardEvent) => any | null
Inherited From GlobalEventHandlers.onkeyup
onload
onload: (this: GlobalEventHandlers, ev: Event) => any | null
Property Value
(this: GlobalEventHandlers, ev: Event) => any | null
Inherited From GlobalEventHandlers.onload
onloadeddata
onloadeddata: (this: GlobalEventHandlers, ev: Event) => any | null
Property Value
(this: GlobalEventHandlers, ev: Event) => any | null
Inherited From GlobalEventHandlers.onloadeddata
onloadedmetadata
onloadedmetadata: (this: GlobalEventHandlers, ev: Event) => any | null
Property Value
(this: GlobalEventHandlers, ev: Event) => any | null
Inherited From GlobalEventHandlers.onloadedmetadata
onloadstart
onloadstart: (this: GlobalEventHandlers, ev: Event) => any | null
Property Value
(this: GlobalEventHandlers, ev: Event) => any | null
Inherited From GlobalEventHandlers.onloadstart
onlostpointercapture
onlostpointercapture: (this: GlobalEventHandlers, ev: PointerEvent) => any | null
Property Value
(this: GlobalEventHandlers, ev: PointerEvent) => any | null
Inherited From GlobalEventHandlers.onlostpointercapture
onmousedown
onmousedown: (this: GlobalEventHandlers, ev: MouseEvent) => any | null
Property Value
(this: GlobalEventHandlers, ev: MouseEvent) => any | null
Inherited From GlobalEventHandlers.onmousedown
onmouseenter
onmouseenter: (this: GlobalEventHandlers, ev: MouseEvent) => any | null
Property Value
(this: GlobalEventHandlers, ev: MouseEvent) => any | null
Inherited From GlobalEventHandlers.onmouseenter
onmouseleave
onmouseleave: (this: GlobalEventHandlers, ev: MouseEvent) => any | null
Property Value
(this: GlobalEventHandlers, ev: MouseEvent) => any | null
Inherited From GlobalEventHandlers.onmouseleave
onmousemove
onmousemove: (this: GlobalEventHandlers, ev: MouseEvent) => any | null
Property Value
(this: GlobalEventHandlers, ev: MouseEvent) => any | null
Inherited From GlobalEventHandlers.onmousemove
onmouseout
onmouseout: (this: GlobalEventHandlers, ev: MouseEvent) => any | null
Property Value
(this: GlobalEventHandlers, ev: MouseEvent) => any | null
Inherited From GlobalEventHandlers.onmouseout
onmouseover
onmouseover: (this: GlobalEventHandlers, ev: MouseEvent) => any | null
Property Value
(this: GlobalEventHandlers, ev: MouseEvent) => any | null
Inherited From GlobalEventHandlers.onmouseover
onmouseup
onmouseup: (this: GlobalEventHandlers, ev: MouseEvent) => any | null
Property Value
(this: GlobalEventHandlers, ev: MouseEvent) => any | null
Inherited From GlobalEventHandlers.onmouseup
onpaste
onpaste: (this: GlobalEventHandlers, ev: ClipboardEvent) => any | null
Property Value
(this: GlobalEventHandlers, ev: ClipboardEvent) => any | null
Inherited From GlobalEventHandlers.onpaste
onpause
onpause: (this: GlobalEventHandlers, ev: Event) => any | null
Property Value
(this: GlobalEventHandlers, ev: Event) => any | null
Inherited From GlobalEventHandlers.onpause
onplay
onplay: (this: GlobalEventHandlers, ev: Event) => any | null
Property Value
(this: GlobalEventHandlers, ev: Event) => any | null
Inherited From GlobalEventHandlers.onplay
onplaying
onplaying: (this: GlobalEventHandlers, ev: Event) => any | null
Property Value
(this: GlobalEventHandlers, ev: Event) => any | null
Inherited From GlobalEventHandlers.onplaying
onpointercancel
onpointercancel: (this: GlobalEventHandlers, ev: PointerEvent) => any | null
Property Value
(this: GlobalEventHandlers, ev: PointerEvent) => any | null
Inherited From GlobalEventHandlers.onpointercancel
onpointerdown
onpointerdown: (this: GlobalEventHandlers, ev: PointerEvent) => any | null
Property Value
(this: GlobalEventHandlers, ev: PointerEvent) => any | null
Inherited From GlobalEventHandlers.onpointerdown
onpointerenter
onpointerenter: (this: GlobalEventHandlers, ev: PointerEvent) => any | null
Property Value
(this: GlobalEventHandlers, ev: PointerEvent) => any | null
Inherited From GlobalEventHandlers.onpointerenter
onpointerleave
onpointerleave: (this: GlobalEventHandlers, ev: PointerEvent) => any | null
Property Value
(this: GlobalEventHandlers, ev: PointerEvent) => any | null
Inherited From GlobalEventHandlers.onpointerleave
onpointermove
onpointermove: (this: GlobalEventHandlers, ev: PointerEvent) => any | null
Property Value
(this: GlobalEventHandlers, ev: PointerEvent) => any | null
Inherited From GlobalEventHandlers.onpointermove
onpointerout
onpointerout: (this: GlobalEventHandlers, ev: PointerEvent) => any | null
Property Value
(this: GlobalEventHandlers, ev: PointerEvent) => any | null
Inherited From GlobalEventHandlers.onpointerout
onpointerover
onpointerover: (this: GlobalEventHandlers, ev: PointerEvent) => any | null
Property Value
(this: GlobalEventHandlers, ev: PointerEvent) => any | null
Inherited From GlobalEventHandlers.onpointerover
onpointerrawupdate
Available only in secure contexts.
onpointerrawupdate: (this: GlobalEventHandlers, ev: Event) => any | null
Property Value
(this: GlobalEventHandlers, ev: Event) => any | null
Inherited From GlobalEventHandlers.onpointerrawupdate
onpointerup
onpointerup: (this: GlobalEventHandlers, ev: PointerEvent) => any | null
Property Value
(this: GlobalEventHandlers, ev: PointerEvent) => any | null
Inherited From GlobalEventHandlers.onpointerup
onprogress
onprogress: (this: GlobalEventHandlers, ev: ProgressEvent) => any | null
Property Value
(this: GlobalEventHandlers, ev: ProgressEvent) => any | null
Inherited From GlobalEventHandlers.onprogress
onratechange
onratechange: (this: GlobalEventHandlers, ev: Event) => any | null
Property Value
(this: GlobalEventHandlers, ev: Event) => any | null
Inherited From GlobalEventHandlers.onratechange
onreset
onreset: (this: GlobalEventHandlers, ev: Event) => any | null
Property Value
(this: GlobalEventHandlers, ev: Event) => any | null
Inherited From GlobalEventHandlers.onreset
onresize
onresize: (this: GlobalEventHandlers, ev: UIEvent) => any | null
Property Value
(this: GlobalEventHandlers, ev: UIEvent) => any | null
Inherited From GlobalEventHandlers.onresize
onscroll
onscroll: (this: GlobalEventHandlers, ev: Event) => any | null
Property Value
(this: GlobalEventHandlers, ev: Event) => any | null
Inherited From GlobalEventHandlers.onscroll
onscrollend
onscrollend: (this: GlobalEventHandlers, ev: Event) => any | null
Property Value
(this: GlobalEventHandlers, ev: Event) => any | null
Inherited From GlobalEventHandlers.onscrollend
onsecuritypolicyviolation
onsecuritypolicyviolation: (this: GlobalEventHandlers, ev: SecurityPolicyViolationEvent) => any | null
Property Value
(this: GlobalEventHandlers, ev: SecurityPolicyViolationEvent) => any | null
Inherited From GlobalEventHandlers.onsecuritypolicyviolation
onseeked
onseeked: (this: GlobalEventHandlers, ev: Event) => any | null
Property Value
(this: GlobalEventHandlers, ev: Event) => any | null
Inherited From GlobalEventHandlers.onseeked
onseeking
onseeking: (this: GlobalEventHandlers, ev: Event) => any | null
Property Value
(this: GlobalEventHandlers, ev: Event) => any | null
Inherited From GlobalEventHandlers.onseeking
onselect
onselect: (this: GlobalEventHandlers, ev: Event) => any | null
Property Value
(this: GlobalEventHandlers, ev: Event) => any | null
Inherited From GlobalEventHandlers.onselect
onselectionchange
onselectionchange: (this: GlobalEventHandlers, ev: Event) => any | null
Property Value
(this: GlobalEventHandlers, ev: Event) => any | null
Inherited From GlobalEventHandlers.onselectionchange
onselectstart
onselectstart: (this: GlobalEventHandlers, ev: Event) => any | null
Property Value
(this: GlobalEventHandlers, ev: Event) => any | null
Inherited From GlobalEventHandlers.onselectstart
onslotchange
onslotchange: (this: GlobalEventHandlers, ev: Event) => any | null
Property Value
(this: GlobalEventHandlers, ev: Event) => any | null
Inherited From GlobalEventHandlers.onslotchange
onstalled
onstalled: (this: GlobalEventHandlers, ev: Event) => any | null
Property Value
(this: GlobalEventHandlers, ev: Event) => any | null
Inherited From GlobalEventHandlers.onstalled
onsubmit
onsubmit: (this: GlobalEventHandlers, ev: SubmitEvent) => any | null
Property Value
(this: GlobalEventHandlers, ev: SubmitEvent) => any | null
Inherited From GlobalEventHandlers.onsubmit
onsuspend
onsuspend: (this: GlobalEventHandlers, ev: Event) => any | null
Property Value
(this: GlobalEventHandlers, ev: Event) => any | null
Inherited From GlobalEventHandlers.onsuspend
ontimeupdate
ontimeupdate: (this: GlobalEventHandlers, ev: Event) => any | null
Property Value
(this: GlobalEventHandlers, ev: Event) => any | null
Inherited From GlobalEventHandlers.ontimeupdate
ontoggle
ontoggle: (this: GlobalEventHandlers, ev: ToggleEvent) => any | null
Property Value
(this: GlobalEventHandlers, ev: ToggleEvent) => any | null
Inherited From GlobalEventHandlers.ontoggle
ontouchcancel
ontouchcancel?: (this: GlobalEventHandlers, ev: TouchEvent) => any | null
Property Value
(this: GlobalEventHandlers, ev: TouchEvent) => any | null
Inherited From GlobalEventHandlers.ontouchcancel
ontouchend
ontouchend?: (this: GlobalEventHandlers, ev: TouchEvent) => any | null
Property Value
(this: GlobalEventHandlers, ev: TouchEvent) => any | null
Inherited From GlobalEventHandlers.ontouchend
ontouchmove
ontouchmove?: (this: GlobalEventHandlers, ev: TouchEvent) => any | null
Property Value
(this: GlobalEventHandlers, ev: TouchEvent) => any | null
Inherited From GlobalEventHandlers.ontouchmove
ontouchstart
ontouchstart?: (this: GlobalEventHandlers, ev: TouchEvent) => any | null
Property Value
(this: GlobalEventHandlers, ev: TouchEvent) => any | null
Inherited From GlobalEventHandlers.ontouchstart
ontransitioncancel
ontransitioncancel: (this: GlobalEventHandlers, ev: TransitionEvent) => any | null
Property Value
(this: GlobalEventHandlers, ev: TransitionEvent) => any | null
Inherited From GlobalEventHandlers.ontransitioncancel
ontransitionend
ontransitionend: (this: GlobalEventHandlers, ev: TransitionEvent) => any | null
Property Value
(this: GlobalEventHandlers, ev: TransitionEvent) => any | null
Inherited From GlobalEventHandlers.ontransitionend
ontransitionrun
ontransitionrun: (this: GlobalEventHandlers, ev: TransitionEvent) => any | null
Property Value
(this: GlobalEventHandlers, ev: TransitionEvent) => any | null
Inherited From GlobalEventHandlers.ontransitionrun
ontransitionstart
ontransitionstart: (this: GlobalEventHandlers, ev: TransitionEvent) => any | null
Property Value
(this: GlobalEventHandlers, ev: TransitionEvent) => any | null
Inherited From GlobalEventHandlers.ontransitionstart
onvolumechange
onvolumechange: (this: GlobalEventHandlers, ev: Event) => any | null
Property Value
(this: GlobalEventHandlers, ev: Event) => any | null
Inherited From GlobalEventHandlers.onvolumechange
onwaiting
onwaiting: (this: GlobalEventHandlers, ev: Event) => any | null
Property Value
(this: GlobalEventHandlers, ev: Event) => any | null
Inherited From GlobalEventHandlers.onwaiting
onwebkitanimationend
onwebkitanimationend: (this: GlobalEventHandlers, ev: Event) => any | null
Property Value
(this: GlobalEventHandlers, ev: Event) => any | null
Inherited From GlobalEventHandlers.onwebkitanimationend
onwebkitanimationiteration
onwebkitanimationiteration: (this: GlobalEventHandlers, ev: Event) => any | null
Property Value
(this: GlobalEventHandlers, ev: Event) => any | null
Inherited From GlobalEventHandlers.onwebkitanimationiteration
onwebkitanimationstart
onwebkitanimationstart: (this: GlobalEventHandlers, ev: Event) => any | null
Property Value
(this: GlobalEventHandlers, ev: Event) => any | null
Inherited From GlobalEventHandlers.onwebkitanimationstart
onwebkittransitionend
onwebkittransitionend: (this: GlobalEventHandlers, ev: Event) => any | null
Property Value
(this: GlobalEventHandlers, ev: Event) => any | null
Inherited From GlobalEventHandlers.onwebkittransitionend
onwheel
onwheel: (this: GlobalEventHandlers, ev: WheelEvent) => any | null
Property Value
(this: GlobalEventHandlers, ev: WheelEvent) => any | null
Inherited From GlobalEventHandlers.onwheel
parentElement
The read-only parentElement property of Node interface returns the DOM node's parent Element, or null if the node either has no parent, or its parent isn't a DOM Element.
parentElement: HTMLElement | null
Property Value
HTMLElement | null
Inherited From Node.parentElement
parentNode
The read-only parentNode property of the Node interface returns the parent of the specified node in the DOM tree.
parentNode: ParentNode | null
Property Value
ParentNode | null
Inherited From Node.parentNode
pictureInPictureElement
pictureInPictureElement: Element | null
Property Value
Element | null
Inherited From DocumentOrShadowRoot.pictureInPictureElement
pointerLockElement
pointerLockElement: Element | null
Property Value
Element | null
Inherited From DocumentOrShadowRoot.pointerLockElement
previousSibling
The read-only previousSibling property of the Node interface returns the node immediately preceding the specified one in its parent's or null if the specified node is the first in that list.
previousSibling: ChildNode | null
Property Value
ChildNode | null
Inherited From Node.previousSibling
PROCESSING_INSTRUCTION_NODE
node is a ProcessingInstruction node.
PROCESSING_INSTRUCTION_NODE: 7
Property Value
7
Inherited From Node.PROCESSING_INSTRUCTION_NODE
styleSheets
styleSheets: StyleSheetList
Property Value
StyleSheetList
Inherited From DocumentOrShadowRoot.styleSheets
TEXT_NODE
node is a Text node.
TEXT_NODE: 3
Property Value
3
Inherited From Node.TEXT_NODE
Method Details
addEventListener(string, EventListenerOrEventListenerObject, boolean | AddEventListenerOptions)
function addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions)
Parameters
- type
-
string
- listener
-
EventListenerOrEventListenerObject
- options
-
boolean | AddEventListenerOptions
addEventListener<K>(K, (this: Document, ev: DocumentEventMap[K]) => any, boolean | AddEventListenerOptions)
The addEventListener() method of the EventTarget interface sets up a function that will be called whenever the specified event is delivered to the target.
function addEventListener<K>(type: K, listener: (this: Document, ev: DocumentEventMap[K]) => any, options?: boolean | AddEventListenerOptions)
Parameters
- type
-
K
- listener
-
(this: Document, ev: DocumentEventMap[K]) => any
- options
-
boolean | AddEventListenerOptions
adoptNode<T>(T)
Document.adoptNode() transfers a node/dom from another Document into the method's document.
function adoptNode<T>(node: T): T
Parameters
- node
-
T
Returns
T
captureEvents()
Warning
This API is now deprecated.
function captureEvents()
caretPositionFromPoint(number, number, CaretPositionFromPointOptions)
The caretPositionFromPoint() method of the Document interface returns a CaretPosition object, containing the DOM node, along with the caret and caret's character offset within that node.
function caretPositionFromPoint(x: number, y: number, options?: CaretPositionFromPointOptions): CaretPosition | null
Parameters
- x
-
number
- y
-
number
- options
-
CaretPositionFromPointOptions
Returns
CaretPosition | null
caretRangeFromPoint(number, number)
Warning
This API is now deprecated.
function caretRangeFromPoint(x: number, y: number): Range | null
Parameters
- x
-
number
- y
-
number
Returns
Range | null
clear()
The Document.clear() method does nothing, but doesn't raise any error.
function clear()
close()
The Document.close() method finishes writing to a document, opened with Document.open().
function close()
createAttribute(string)
The Document.createAttribute() method creates a new attribute node, and returns it.
function createAttribute(localName: string): Attr
Parameters
- localName
-
string
Returns
Attr
createAttributeNS(string | null, string)
The Document.createAttributeNS() method creates a new attribute node with the specified namespace URI and qualified name, and returns it.
function createAttributeNS(namespace: string | null, qualifiedName: string): Attr
Parameters
- namespace
-
string | null
- qualifiedName
-
string
Returns
Attr
createCDATASection(string)
createCDATASection() creates a new CDATA section node, and returns it.
function createCDATASection(data: string): CDATASection
Parameters
- data
-
string
Returns
CDATASection
createComment(string)
createComment() creates a new comment node, and returns it.
function createComment(data: string): Comment
Parameters
- data
-
string
Returns
Comment
createDocumentFragment()
Creates a new empty DocumentFragment into which DOM nodes can be added to build an offscreen DOM tree.
function createDocumentFragment(): DocumentFragment
Returns
DocumentFragment
createElement(string, ElementCreationOptions)
function createElement(tagName: string, options?: ElementCreationOptions): HTMLElement
Parameters
- tagName
-
string
- options
-
ElementCreationOptions
Returns
HTMLElement
createElement<K>(K, ElementCreationOptions)
In an HTML document, the document.createElement() method creates the HTML element specified by localName, or an HTMLUnknownElement if localName isn't recognized.
function createElement<K>(tagName: K, options?: ElementCreationOptions): HTMLElementTagNameMap[K]
Parameters
- tagName
-
K
- options
-
ElementCreationOptions
Returns
HTMLElementTagNameMap[K]
createElement<K>(K, ElementCreationOptions)
Warning
This API is now deprecated.
function createElement<K>(tagName: K, options?: ElementCreationOptions): HTMLElementDeprecatedTagNameMap[K]
Parameters
- tagName
-
K
- options
-
ElementCreationOptions
Returns
HTMLElementDeprecatedTagNameMap[K]
createElementNS("http://www.w3.org/1998/Math/MathML", string)
function createElementNS(namespaceURI: "http://www.w3.org/1998/Math/MathML", qualifiedName: string): MathMLElement
Parameters
- namespaceURI
-
"http://www.w3.org/1998/Math/MathML"
- qualifiedName
-
string
Returns
MathMLElement
createElementNS("http://www.w3.org/1999/xhtml", string)
Creates an element with the specified namespace URI and qualified name.
function createElementNS(namespaceURI: "http://www.w3.org/1999/xhtml", qualifiedName: string): HTMLElement
Parameters
- namespaceURI
-
"http://www.w3.org/1999/xhtml"
- qualifiedName
-
string
Returns
HTMLElement
createElementNS("http://www.w3.org/2000/svg", string)
function createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: string): SVGElement
Parameters
- namespaceURI
-
"http://www.w3.org/2000/svg"
- qualifiedName
-
string
Returns
SVGElement
createElementNS(string | null, string, ElementCreationOptions)
function createElementNS(namespaceURI: string | null, qualifiedName: string, options?: ElementCreationOptions): Element
Parameters
- namespaceURI
-
string | null
- qualifiedName
-
string
- options
-
ElementCreationOptions
Returns
Element
createElementNS(string | null, string, string | ElementCreationOptions)
function createElementNS(namespace: string | null, qualifiedName: string, options?: string | ElementCreationOptions): Element
Parameters
- namespace
-
string | null
- qualifiedName
-
string
- options
-
string | ElementCreationOptions
Returns
Element
createElementNS<K>("http://www.w3.org/1998/Math/MathML", K)
function createElementNS<K>(namespaceURI: "http://www.w3.org/1998/Math/MathML", qualifiedName: K): MathMLElementTagNameMap[K]
Parameters
- namespaceURI
-
"http://www.w3.org/1998/Math/MathML"
- qualifiedName
-
K
Returns
MathMLElementTagNameMap[K]
createElementNS<K>("http://www.w3.org/2000/svg", K)
function createElementNS<K>(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: K): SVGElementTagNameMap[K]
Parameters
- namespaceURI
-
"http://www.w3.org/2000/svg"
- qualifiedName
-
K
Returns
SVGElementTagNameMap[K]
createEvent("AnimationEvent")
Creates an event of the type specified.
function createEvent(eventInterface: "AnimationEvent"): AnimationEvent
Parameters
- eventInterface
-
"AnimationEvent"
Returns
AnimationEvent
createEvent("AnimationPlaybackEvent")
function createEvent(eventInterface: "AnimationPlaybackEvent"): AnimationPlaybackEvent
Parameters
- eventInterface
-
"AnimationPlaybackEvent"
Returns
AnimationPlaybackEvent
createEvent("AudioProcessingEvent")
function createEvent(eventInterface: "AudioProcessingEvent"): AudioProcessingEvent
Parameters
- eventInterface
-
"AudioProcessingEvent"
Returns
AudioProcessingEvent
createEvent("BeforeUnloadEvent")
function createEvent(eventInterface: "BeforeUnloadEvent"): BeforeUnloadEvent
Parameters
- eventInterface
-
"BeforeUnloadEvent"
Returns
BeforeUnloadEvent
createEvent("BlobEvent")
function createEvent(eventInterface: "BlobEvent"): BlobEvent
Parameters
- eventInterface
-
"BlobEvent"
Returns
BlobEvent
createEvent("ClipboardEvent")
function createEvent(eventInterface: "ClipboardEvent"): ClipboardEvent
Parameters
- eventInterface
-
"ClipboardEvent"
Returns
ClipboardEvent
createEvent("CloseEvent")
function createEvent(eventInterface: "CloseEvent"): CloseEvent
Parameters
- eventInterface
-
"CloseEvent"
Returns
CloseEvent
createEvent("CompositionEvent")
function createEvent(eventInterface: "CompositionEvent"): CompositionEvent
Parameters
- eventInterface
-
"CompositionEvent"
Returns
CompositionEvent
createEvent("ContentVisibilityAutoStateChangeEvent")
function createEvent(eventInterface: "ContentVisibilityAutoStateChangeEvent"): ContentVisibilityAutoStateChangeEvent
Parameters
- eventInterface
-
"ContentVisibilityAutoStateChangeEvent"
Returns
ContentVisibilityAutoStateChangeEvent
createEvent("CookieChangeEvent")
function createEvent(eventInterface: "CookieChangeEvent"): CookieChangeEvent
Parameters
- eventInterface
-
"CookieChangeEvent"
Returns
CookieChangeEvent
createEvent("CustomEvent")
function createEvent(eventInterface: "CustomEvent"): CustomEvent
Parameters
- eventInterface
-
"CustomEvent"
Returns
CustomEvent
createEvent("DeviceMotionEvent")
function createEvent(eventInterface: "DeviceMotionEvent"): DeviceMotionEvent
Parameters
- eventInterface
-
"DeviceMotionEvent"
Returns
DeviceMotionEvent
createEvent("DeviceOrientationEvent")
function createEvent(eventInterface: "DeviceOrientationEvent"): DeviceOrientationEvent
Parameters
- eventInterface
-
"DeviceOrientationEvent"
Returns
DeviceOrientationEvent
createEvent("DragEvent")
function createEvent(eventInterface: "DragEvent"): DragEvent
Parameters
- eventInterface
-
"DragEvent"
Returns
DragEvent
createEvent("ErrorEvent")
function createEvent(eventInterface: "ErrorEvent"): ErrorEvent
Parameters
- eventInterface
-
"ErrorEvent"
Returns
ErrorEvent
createEvent("Event")
function createEvent(eventInterface: "Event"): Event
Parameters
- eventInterface
-
"Event"
Returns
Event
createEvent("Events")
function createEvent(eventInterface: "Events"): Event
Parameters
- eventInterface
-
"Events"
Returns
Event
createEvent("FocusEvent")
function createEvent(eventInterface: "FocusEvent"): FocusEvent
Parameters
- eventInterface
-
"FocusEvent"
Returns
FocusEvent
createEvent("FontFaceSetLoadEvent")
function createEvent(eventInterface: "FontFaceSetLoadEvent"): FontFaceSetLoadEvent
Parameters
- eventInterface
-
"FontFaceSetLoadEvent"
Returns
FontFaceSetLoadEvent
createEvent("FormDataEvent")
function createEvent(eventInterface: "FormDataEvent"): FormDataEvent
Parameters
- eventInterface
-
"FormDataEvent"
Returns
FormDataEvent
createEvent("GamepadEvent")
function createEvent(eventInterface: "GamepadEvent"): GamepadEvent
Parameters
- eventInterface
-
"GamepadEvent"
Returns
GamepadEvent
createEvent("HashChangeEvent")
function createEvent(eventInterface: "HashChangeEvent"): HashChangeEvent
Parameters
- eventInterface
-
"HashChangeEvent"
Returns
HashChangeEvent
createEvent("IDBVersionChangeEvent")
function createEvent(eventInterface: "IDBVersionChangeEvent"): IDBVersionChangeEvent
Parameters
- eventInterface
-
"IDBVersionChangeEvent"
Returns
IDBVersionChangeEvent
createEvent("InputEvent")
function createEvent(eventInterface: "InputEvent"): InputEvent
Parameters
- eventInterface
-
"InputEvent"
Returns
InputEvent
createEvent("KeyboardEvent")
function createEvent(eventInterface: "KeyboardEvent"): KeyboardEvent
Parameters
- eventInterface
-
"KeyboardEvent"
Returns
KeyboardEvent
createEvent("MediaEncryptedEvent")
function createEvent(eventInterface: "MediaEncryptedEvent"): MediaEncryptedEvent
Parameters
- eventInterface
-
"MediaEncryptedEvent"
Returns
MediaEncryptedEvent
createEvent("MediaKeyMessageEvent")
function createEvent(eventInterface: "MediaKeyMessageEvent"): MediaKeyMessageEvent
Parameters
- eventInterface
-
"MediaKeyMessageEvent"
Returns
MediaKeyMessageEvent
createEvent("MediaQueryListEvent")
function createEvent(eventInterface: "MediaQueryListEvent"): MediaQueryListEvent
Parameters
- eventInterface
-
"MediaQueryListEvent"
Returns
MediaQueryListEvent
createEvent("MediaStreamTrackEvent")
function createEvent(eventInterface: "MediaStreamTrackEvent"): MediaStreamTrackEvent
Parameters
- eventInterface
-
"MediaStreamTrackEvent"
Returns
MediaStreamTrackEvent
createEvent("MessageEvent")
function createEvent(eventInterface: "MessageEvent"): MessageEvent
Parameters
- eventInterface
-
"MessageEvent"
Returns
MessageEvent
createEvent("MIDIConnectionEvent")
function createEvent(eventInterface: "MIDIConnectionEvent"): MIDIConnectionEvent
Parameters
- eventInterface
-
"MIDIConnectionEvent"
Returns
MIDIConnectionEvent
createEvent("MIDIMessageEvent")
function createEvent(eventInterface: "MIDIMessageEvent"): MIDIMessageEvent
Parameters
- eventInterface
-
"MIDIMessageEvent"
Returns
MIDIMessageEvent
createEvent("MouseEvent")
function createEvent(eventInterface: "MouseEvent"): MouseEvent
Parameters
- eventInterface
-
"MouseEvent"
Returns
MouseEvent
createEvent("MouseEvents")
function createEvent(eventInterface: "MouseEvents"): MouseEvent
Parameters
- eventInterface
-
"MouseEvents"
Returns
MouseEvent
createEvent("OfflineAudioCompletionEvent")
function createEvent(eventInterface: "OfflineAudioCompletionEvent"): OfflineAudioCompletionEvent
Parameters
- eventInterface
-
"OfflineAudioCompletionEvent"
Returns
OfflineAudioCompletionEvent
createEvent("PageRevealEvent")
function createEvent(eventInterface: "PageRevealEvent"): PageRevealEvent
Parameters
- eventInterface
-
"PageRevealEvent"
Returns
PageRevealEvent
createEvent("PageSwapEvent")
function createEvent(eventInterface: "PageSwapEvent"): PageSwapEvent
Parameters
- eventInterface
-
"PageSwapEvent"
Returns
PageSwapEvent
createEvent("PageTransitionEvent")
function createEvent(eventInterface: "PageTransitionEvent"): PageTransitionEvent
Parameters
- eventInterface
-
"PageTransitionEvent"
Returns
PageTransitionEvent
createEvent("PaymentMethodChangeEvent")
function createEvent(eventInterface: "PaymentMethodChangeEvent"): PaymentMethodChangeEvent
Parameters
- eventInterface
-
"PaymentMethodChangeEvent"
Returns
PaymentMethodChangeEvent
createEvent("PaymentRequestUpdateEvent")
function createEvent(eventInterface: "PaymentRequestUpdateEvent"): PaymentRequestUpdateEvent
Parameters
- eventInterface
-
"PaymentRequestUpdateEvent"
Returns
PaymentRequestUpdateEvent
createEvent("PictureInPictureEvent")
function createEvent(eventInterface: "PictureInPictureEvent"): PictureInPictureEvent
Parameters
- eventInterface
-
"PictureInPictureEvent"
Returns
PictureInPictureEvent
createEvent("PointerEvent")
function createEvent(eventInterface: "PointerEvent"): PointerEvent
Parameters
- eventInterface
-
"PointerEvent"
Returns
PointerEvent
createEvent("PopStateEvent")
function createEvent(eventInterface: "PopStateEvent"): PopStateEvent
Parameters
- eventInterface
-
"PopStateEvent"
Returns
PopStateEvent
createEvent("ProgressEvent")
function createEvent(eventInterface: "ProgressEvent"): ProgressEvent
Parameters
- eventInterface
-
"ProgressEvent"
Returns
ProgressEvent
createEvent("PromiseRejectionEvent")
function createEvent(eventInterface: "PromiseRejectionEvent"): PromiseRejectionEvent
Parameters
- eventInterface
-
"PromiseRejectionEvent"
Returns
PromiseRejectionEvent
createEvent("RTCDataChannelEvent")
function createEvent(eventInterface: "RTCDataChannelEvent"): RTCDataChannelEvent
Parameters
- eventInterface
-
"RTCDataChannelEvent"
Returns
RTCDataChannelEvent
createEvent("RTCDTMFToneChangeEvent")
function createEvent(eventInterface: "RTCDTMFToneChangeEvent"): RTCDTMFToneChangeEvent
Parameters
- eventInterface
-
"RTCDTMFToneChangeEvent"
Returns
RTCDTMFToneChangeEvent
createEvent("RTCErrorEvent")
function createEvent(eventInterface: "RTCErrorEvent"): RTCErrorEvent
Parameters
- eventInterface
-
"RTCErrorEvent"
Returns
RTCErrorEvent
createEvent("RTCPeerConnectionIceErrorEvent")
function createEvent(eventInterface: "RTCPeerConnectionIceErrorEvent"): RTCPeerConnectionIceErrorEvent
Parameters
- eventInterface
-
"RTCPeerConnectionIceErrorEvent"
Returns
RTCPeerConnectionIceErrorEvent
createEvent("RTCPeerConnectionIceEvent")
function createEvent(eventInterface: "RTCPeerConnectionIceEvent"): RTCPeerConnectionIceEvent
Parameters
- eventInterface
-
"RTCPeerConnectionIceEvent"
Returns
RTCPeerConnectionIceEvent
createEvent("RTCTrackEvent")
function createEvent(eventInterface: "RTCTrackEvent"): RTCTrackEvent
Parameters
- eventInterface
-
"RTCTrackEvent"
Returns
RTCTrackEvent
createEvent("SecurityPolicyViolationEvent")
function createEvent(eventInterface: "SecurityPolicyViolationEvent"): SecurityPolicyViolationEvent
Parameters
- eventInterface
-
"SecurityPolicyViolationEvent"
Returns
SecurityPolicyViolationEvent
createEvent("SpeechSynthesisErrorEvent")
function createEvent(eventInterface: "SpeechSynthesisErrorEvent"): SpeechSynthesisErrorEvent
Parameters
- eventInterface
-
"SpeechSynthesisErrorEvent"
Returns
SpeechSynthesisErrorEvent
createEvent("SpeechSynthesisEvent")
function createEvent(eventInterface: "SpeechSynthesisEvent"): SpeechSynthesisEvent
Parameters
- eventInterface
-
"SpeechSynthesisEvent"
Returns
SpeechSynthesisEvent
createEvent("StorageEvent")
function createEvent(eventInterface: "StorageEvent"): StorageEvent
Parameters
- eventInterface
-
"StorageEvent"
Returns
StorageEvent
createEvent("SubmitEvent")
function createEvent(eventInterface: "SubmitEvent"): SubmitEvent
Parameters
- eventInterface
-
"SubmitEvent"
Returns
SubmitEvent
createEvent("TextEvent")
function createEvent(eventInterface: "TextEvent"): TextEvent
Parameters
- eventInterface
-
"TextEvent"
Returns
TextEvent
createEvent("ToggleEvent")
function createEvent(eventInterface: "ToggleEvent"): ToggleEvent
Parameters
- eventInterface
-
"ToggleEvent"
Returns
ToggleEvent
createEvent("TouchEvent")
function createEvent(eventInterface: "TouchEvent"): TouchEvent
Parameters
- eventInterface
-
"TouchEvent"
Returns
TouchEvent
createEvent("TrackEvent")
function createEvent(eventInterface: "TrackEvent"): TrackEvent
Parameters
- eventInterface
-
"TrackEvent"
Returns
TrackEvent
createEvent("TransitionEvent")
function createEvent(eventInterface: "TransitionEvent"): TransitionEvent
Parameters
- eventInterface
-
"TransitionEvent"
Returns
TransitionEvent
createEvent("UIEvent")
function createEvent(eventInterface: "UIEvent"): UIEvent
Parameters
- eventInterface
-
"UIEvent"
Returns
UIEvent
createEvent("UIEvents")
function createEvent(eventInterface: "UIEvents"): UIEvent
Parameters
- eventInterface
-
"UIEvents"
Returns
UIEvent
createEvent("WebGLContextEvent")
function createEvent(eventInterface: "WebGLContextEvent"): WebGLContextEvent
Parameters
- eventInterface
-
"WebGLContextEvent"
Returns
WebGLContextEvent
createEvent("WheelEvent")
function createEvent(eventInterface: "WheelEvent"): WheelEvent
Parameters
- eventInterface
-
"WheelEvent"
Returns
WheelEvent
createEvent(string)
function createEvent(eventInterface: string): Event
Parameters
- eventInterface
-
string
Returns
Event
createNodeIterator(Node, number, NodeFilter | null)
The Document.createNodeIterator() method returns a new NodeIterator object.
function createNodeIterator(root: Node, whatToShow?: number, filter?: NodeFilter | null): NodeIterator
Parameters
- root
-
Node
- whatToShow
-
number
- filter
-
NodeFilter | null
Returns
NodeIterator
createProcessingInstruction(string, string)
createProcessingInstruction() generates a new processing instruction node and returns it.
function createProcessingInstruction(target: string, data: string): ProcessingInstruction
Parameters
- target
-
string
- data
-
string
Returns
ProcessingInstruction
createRange()
The Document.createRange() method returns a new js-nolint createRange() None.
function createRange(): Range
Returns
Range
createTextNode(string)
Creates a new Text node.
function createTextNode(data: string): Text
Parameters
- data
-
string
Returns
Text
createTreeWalker(Node, number, NodeFilter | null)
The Document.createTreeWalker() creator method returns a newly created TreeWalker object.
function createTreeWalker(root: Node, whatToShow?: number, filter?: NodeFilter | null): TreeWalker
Parameters
- root
-
Node
- whatToShow
-
number
- filter
-
NodeFilter | null
Returns
TreeWalker
execCommand(string, boolean, string)
The execCommand method implements multiple different commands.
function execCommand(commandId: string, showUI?: boolean, value?: string): boolean
Parameters
- commandId
-
string
- showUI
-
boolean
- value
-
string
Returns
boolean
exitFullscreen()
The Document method exitFullscreen() requests that the element on this document which is currently being presented in fullscreen mode be taken out of fullscreen mode, restoring the previous state of the screen.
function exitFullscreen(): Promise<void>
Returns
Promise<void>
exitPictureInPicture()
The exitPictureInPicture() method of the Document interface requests that a video contained in this document, which is currently floating, be taken out of picture-in-picture mode, restoring the previous state of the screen.
function exitPictureInPicture(): Promise<void>
Returns
Promise<void>
exitPointerLock()
The exitPointerLock() method of the Document interface asynchronously releases a pointer lock previously requested through Element.requestPointerLock.
function exitPointerLock()
getElementById(string)
Returns the first element within node's descendants whose ID is elementId.
function getElementById(elementId: string): HTMLElement | null
Parameters
- elementId
-
string
Returns
HTMLElement | null
getElementsByClassName(string)
The getElementsByClassName method of of all child elements which have all of the given class name(s).
function getElementsByClassName(classNames: string): HTMLCollectionOf<Element>
Parameters
- classNames
-
string
Returns
HTMLCollectionOf<Element>
getElementsByName(string)
The getElementsByName() method of the Document object returns a NodeList Collection of elements with a given name attribute in the document.
function getElementsByName(elementName: string): NodeListOf<HTMLElement>
Parameters
- elementName
-
string
Returns
NodeListOf<HTMLElement>
getElementsByTagName(string)
function getElementsByTagName(qualifiedName: string): HTMLCollectionOf<Element>
Parameters
- qualifiedName
-
string
Returns
HTMLCollectionOf<Element>
getElementsByTagName<K>(K)
The getElementsByTagName method of The complete document is searched, including the root node.
function getElementsByTagName<K>(qualifiedName: K): HTMLCollectionOf<HTMLElementTagNameMap[K]>
Parameters
- qualifiedName
-
K
Returns
HTMLCollectionOf<HTMLElementTagNameMap[K]>
getElementsByTagName<K>(K)
function getElementsByTagName<K>(qualifiedName: K): HTMLCollectionOf<SVGElementTagNameMap[K]>
Parameters
- qualifiedName
-
K
Returns
HTMLCollectionOf<SVGElementTagNameMap[K]>
getElementsByTagName<K>(K)
function getElementsByTagName<K>(qualifiedName: K): HTMLCollectionOf<MathMLElementTagNameMap[K]>
Parameters
- qualifiedName
-
K
Returns
HTMLCollectionOf<MathMLElementTagNameMap[K]>
getElementsByTagName<K>(K)
Warning
This API is now deprecated.
function getElementsByTagName<K>(qualifiedName: K): HTMLCollectionOf<HTMLElementDeprecatedTagNameMap[K]>
Parameters
- qualifiedName
-
K
Returns
HTMLCollectionOf<HTMLElementDeprecatedTagNameMap[K]>
getElementsByTagNameNS("http://www.w3.org/1998/Math/MathML", string)
function getElementsByTagNameNS(namespaceURI: "http://www.w3.org/1998/Math/MathML", localName: string): HTMLCollectionOf<MathMLElement>
Parameters
- namespaceURI
-
"http://www.w3.org/1998/Math/MathML"
- localName
-
string
Returns
HTMLCollectionOf<MathMLElement>
getElementsByTagNameNS("http://www.w3.org/1999/xhtml", string)
Returns a list of elements with the given tag name belonging to the given namespace.
function getElementsByTagNameNS(namespaceURI: "http://www.w3.org/1999/xhtml", localName: string): HTMLCollectionOf<HTMLElement>
Parameters
- namespaceURI
-
"http://www.w3.org/1999/xhtml"
- localName
-
string
Returns
HTMLCollectionOf<HTMLElement>
getElementsByTagNameNS("http://www.w3.org/2000/svg", string)
function getElementsByTagNameNS(namespaceURI: "http://www.w3.org/2000/svg", localName: string): HTMLCollectionOf<SVGElement>
Parameters
- namespaceURI
-
"http://www.w3.org/2000/svg"
- localName
-
string
Returns
HTMLCollectionOf<SVGElement>
getElementsByTagNameNS(string | null, string)
function getElementsByTagNameNS(namespace: string | null, localName: string): HTMLCollectionOf<Element>
Parameters
- namespace
-
string | null
- localName
-
string
Returns
HTMLCollectionOf<Element>
getSelection()
The getSelection() method of the Document interface returns the Selection object associated with this document, representing the range of text selected by the user, or the current position of the caret.
function getSelection(): Selection | null
Returns
Selection | null
hasFocus()
The hasFocus() method of the Document interface returns a boolean value indicating whether the document or any element inside the document has focus.
function hasFocus(): boolean
Returns
boolean
hasStorageAccess()
The hasStorageAccess() method of the Document interface returns a Promise that resolves with a boolean value indicating whether the document has access to third-party, unpartitioned cookies.
function hasStorageAccess(): Promise<boolean>
Returns
Promise<boolean>
importNode<T>(T, boolean | ImportNodeOptions)
The Document object's importNode() method creates a copy of a inserted into the current document later.
function importNode<T>(node: T, options?: boolean | ImportNodeOptions): T
Parameters
- node
-
T
- options
-
boolean | ImportNodeOptions
Returns
T
open(string | URL, string, string)
function open(url: string | URL, name: string, features: string): Window | null
Parameters
- url
-
string | URL
- name
-
string
- features
-
string
Returns
Window | null
open(string, string)
The Document.open() method opens a document for This does come with some side effects.
function open(unused1?: string, unused2?: string): Document
Parameters
- unused1
-
string
- unused2
-
string
Returns
queryCommandEnabled(string)
The Document.queryCommandEnabled() method reports whether or not the specified editor command is enabled by the browser.
function queryCommandEnabled(commandId: string): boolean
Parameters
- commandId
-
string
Returns
boolean
queryCommandIndeterm(string)
Warning
This API is now deprecated.
function queryCommandIndeterm(commandId: string): boolean
Parameters
- commandId
-
string
Returns
boolean
queryCommandState(string)
The queryCommandState() method will tell you if the current selection has a certain Document.execCommand() command applied.
function queryCommandState(commandId: string): boolean
Parameters
- commandId
-
string
Returns
boolean
queryCommandSupported(string)
The Document.queryCommandSupported() method reports whether or not the specified editor command is supported by the browser.
function queryCommandSupported(commandId: string): boolean
Parameters
- commandId
-
string
Returns
boolean
queryCommandValue(string)
Warning
This API is now deprecated.
function queryCommandValue(commandId: string): string
Parameters
- commandId
-
string
Returns
string
releaseEvents()
Warning
This API is now deprecated.
function releaseEvents()
removeEventListener(string, EventListenerOrEventListenerObject, boolean | EventListenerOptions)
function removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions)
Parameters
- type
-
string
- listener
-
EventListenerOrEventListenerObject
- options
-
boolean | EventListenerOptions
removeEventListener<K>(K, (this: Document, ev: DocumentEventMap[K]) => any, boolean | EventListenerOptions)
The removeEventListener() method of the EventTarget interface removes an event listener previously registered with EventTarget.addEventListener() from the target.
function removeEventListener<K>(type: K, listener: (this: Document, ev: DocumentEventMap[K]) => any, options?: boolean | EventListenerOptions)
Parameters
- type
-
K
- listener
-
(this: Document, ev: DocumentEventMap[K]) => any
- options
-
boolean | EventListenerOptions
requestStorageAccess()
The requestStorageAccess() method of the Document interface allows content loaded in a third-party context (i.e., embedded in an iframe) to request access to third-party cookies and unpartitioned state.
function requestStorageAccess(): Promise<void>
Returns
Promise<void>
startViewTransition(ViewTransitionUpdateCallback | StartViewTransitionOptions)
The startViewTransition() method of the Document interface starts a new same-document (SPA) view transition and returns a ViewTransition object to represent it.
function startViewTransition(callbackOptions?: ViewTransitionUpdateCallback | StartViewTransitionOptions): ViewTransition
Parameters
- callbackOptions
-
ViewTransitionUpdateCallback | StartViewTransitionOptions
Returns
ViewTransition
write(string[])
The write() method of the Document interface writes text in one or more TrustedHTML or string parameters to a document stream opened by document.open().
function write(text: string[])
Parameters
- text
-
string[]
writeln(string[])
The writeln() method of the Document interface writes text in one or more TrustedHTML or string parameters to a document stream opened by document.open(), followed by a newline character.
function writeln(text: string[])
Parameters
- text
-
string[]
Inherited Method Details
append((string | Node)[])
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.
function append(nodes: (string | Node)[])
Parameters
- nodes
-
(string | Node)[]
Inherited From ParentNode.append
appendChild<T>(T)
The appendChild() method of the Node interface adds a node to the end of the list of children of a specified parent node.
function appendChild<T>(node: T): T
Parameters
- node
-
T
Returns
T
Inherited From Node.appendChild
cloneNode(boolean)
The cloneNode() method of the Node interface returns a duplicate of the node on which this method was called.
function cloneNode(subtree?: boolean): Node
Parameters
- subtree
-
boolean
Returns
Node
Inherited From Node.cloneNode
compareDocumentPosition(Node)
The compareDocumentPosition() method of the Node interface reports the position of its argument node relative to the node on which it is called.
function compareDocumentPosition(other: Node): number
Parameters
- other
-
Node
Returns
number
Inherited From Node.compareDocumentPosition
contains(Node | null)
The contains() method of the Node interface returns a boolean value indicating whether a node is a descendant of a given node, that is the node itself, one of its direct children (Node.childNodes), one of the children's direct children, and so on.
function contains(other: Node | null): boolean
Parameters
- other
-
Node | null
Returns
boolean
Inherited From Node.contains
createExpression(string, XPathNSResolver | null)
function createExpression(expression: string, resolver?: XPathNSResolver | null): XPathExpression
Parameters
- expression
-
string
- resolver
-
XPathNSResolver | null
Returns
XPathExpression
Inherited From XPathEvaluatorBase.createExpression
createNSResolver(Node)
function createNSResolver(nodeResolver: Node): Node
Parameters
- nodeResolver
-
Node
Returns
Node
Inherited From XPathEvaluatorBase.createNSResolver
dispatchEvent(Event)
The dispatchEvent() method of the EventTarget sends an Event to the object, (synchronously) invoking the affected event listeners in the appropriate order.
function dispatchEvent(event: Event): boolean
Parameters
- event
-
Event
Returns
boolean
Inherited From Node.dispatchEvent
elementFromPoint(number, number)
function elementFromPoint(x: number, y: number): Element | null
Parameters
- x
-
number
- y
-
number
Returns
Element | null
Inherited From DocumentOrShadowRoot.elementFromPoint
elementsFromPoint(number, number)
function elementsFromPoint(x: number, y: number): Element[]
Parameters
- x
-
number
- y
-
number
Returns
Element[]
Inherited From DocumentOrShadowRoot.elementsFromPoint
evaluate(string, Node, XPathNSResolver | null, number, XPathResult | null)
function evaluate(expression: string, contextNode: Node, resolver?: XPathNSResolver | null, type?: number, result?: XPathResult | null): XPathResult
Parameters
- expression
-
string
- contextNode
-
Node
- resolver
-
XPathNSResolver | null
- type
-
number
- result
-
XPathResult | null
Returns
XPathResult
Inherited From XPathEvaluatorBase.evaluate
getAnimations()
function getAnimations(): Animation[]
Returns
Animation[]
Inherited From DocumentOrShadowRoot.getAnimations
getRootNode(GetRootNodeOptions)
The getRootNode() method of the Node interface returns the context object's root, which optionally includes the shadow root if it is available.
function getRootNode(options?: GetRootNodeOptions): Node
Parameters
- options
-
GetRootNodeOptions
Returns
Node
Inherited From Node.getRootNode
hasChildNodes()
The hasChildNodes() method of the Node interface returns a boolean value indicating whether the given Node has child nodes or not.
function hasChildNodes(): boolean
Returns
boolean
Inherited From Node.hasChildNodes
insertBefore<T>(T, Node | null)
The insertBefore() method of the Node interface inserts a node before a reference node as a child of a specified parent node.
function insertBefore<T>(node: T, child: Node | null): T
Parameters
- node
-
T
- child
-
Node | null
Returns
T
Inherited From Node.insertBefore
isDefaultNamespace(string | null)
The isDefaultNamespace() method of the Node interface accepts a namespace URI as an argument.
function isDefaultNamespace(namespace: string | null): boolean
Parameters
- namespace
-
string | null
Returns
boolean
Inherited From Node.isDefaultNamespace
isEqualNode(Node | null)
The isEqualNode() method of the Node interface tests whether two nodes are equal.
function isEqualNode(otherNode: Node | null): boolean
Parameters
- otherNode
-
Node | null
Returns
boolean
Inherited From Node.isEqualNode
isSameNode(Node | null)
The isSameNode() method of the Node interface is a legacy alias the for the === strict equality operator.
function isSameNode(otherNode: Node | null): boolean
Parameters
- otherNode
-
Node | null
Returns
boolean
Inherited From Node.isSameNode
lookupNamespaceURI(string | null)
The lookupNamespaceURI() method of the Node interface takes a prefix as parameter and returns the namespace URI associated with it on the given node if found (and null if not).
function lookupNamespaceURI(prefix: string | null): string | null
Parameters
- prefix
-
string | null
Returns
string | null
Inherited From Node.lookupNamespaceURI
lookupPrefix(string | null)
The lookupPrefix() method of the Node interface returns a string containing the prefix for a given namespace URI, if present, and null if not.
function lookupPrefix(namespace: string | null): string | null
Parameters
- namespace
-
string | null
Returns
string | null
Inherited From Node.lookupPrefix
normalize()
The normalize() method of the Node interface puts the specified node and all of its sub-tree into a normalized form.
function normalize()
Inherited From Node.normalize
prepend((string | Node)[])
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.
function prepend(nodes: (string | Node)[])
Parameters
- nodes
-
(string | Node)[]
Inherited From ParentNode.prepend
querySelector<E>(string)
function querySelector<E>(selectors: string): E | null
Parameters
- selectors
-
string
Returns
E | null
Inherited From ParentNode.querySelector
querySelector<K>(K)
Returns the first element that is a descendant of node that matches selectors.
function querySelector<K>(selectors: K): HTMLElementTagNameMap[K] | null
Parameters
- selectors
-
K
Returns
HTMLElementTagNameMap[K] | null
Inherited From ParentNode.querySelector
querySelector<K>(K)
function querySelector<K>(selectors: K): SVGElementTagNameMap[K] | null
Parameters
- selectors
-
K
Returns
SVGElementTagNameMap[K] | null
Inherited From ParentNode.querySelector
querySelector<K>(K)
function querySelector<K>(selectors: K): MathMLElementTagNameMap[K] | null
Parameters
- selectors
-
K
Returns
MathMLElementTagNameMap[K] | null
Inherited From ParentNode.querySelector
querySelector<K>(K)
Warning
This API is now deprecated.
function querySelector<K>(selectors: K): HTMLElementDeprecatedTagNameMap[K] | null
Parameters
- selectors
-
K
Returns
HTMLElementDeprecatedTagNameMap[K] | null
Inherited From ParentNode.querySelector
querySelectorAll<E>(string)
function querySelectorAll<E>(selectors: string): NodeListOf<E>
Parameters
- selectors
-
string
Returns
NodeListOf<E>
Inherited From ParentNode.querySelectorAll
querySelectorAll<K>(K)
Returns all element descendants of node that match selectors.
function querySelectorAll<K>(selectors: K): NodeListOf<HTMLElementTagNameMap[K]>
Parameters
- selectors
-
K
Returns
NodeListOf<HTMLElementTagNameMap[K]>
Inherited From ParentNode.querySelectorAll
querySelectorAll<K>(K)
function querySelectorAll<K>(selectors: K): NodeListOf<SVGElementTagNameMap[K]>
Parameters
- selectors
-
K
Returns
NodeListOf<SVGElementTagNameMap[K]>
Inherited From ParentNode.querySelectorAll
querySelectorAll<K>(K)
function querySelectorAll<K>(selectors: K): NodeListOf<MathMLElementTagNameMap[K]>
Parameters
- selectors
-
K
Returns
NodeListOf<MathMLElementTagNameMap[K]>
Inherited From ParentNode.querySelectorAll
querySelectorAll<K>(K)
Warning
This API is now deprecated.
function querySelectorAll<K>(selectors: K): NodeListOf<HTMLElementDeprecatedTagNameMap[K]>
Parameters
- selectors
-
K
Returns
NodeListOf<HTMLElementDeprecatedTagNameMap[K]>
Inherited From ParentNode.querySelectorAll
removeChild<T>(T)
The removeChild() method of the Node interface removes a child node from the DOM and returns the removed node.
function removeChild<T>(child: T): T
Parameters
- child
-
T
Returns
T
Inherited From Node.removeChild
replaceChild<T>(Node, T)
The replaceChild() method of the Node interface replaces a child node within the given (parent) node.
function replaceChild<T>(node: Node, child: T): T
Parameters
- node
-
Node
- child
-
T
Returns
T
Inherited From Node.replaceChild
replaceChildren((string | Node)[])
Replace all children of node with nodes, while replacing strings in nodes with equivalent Text nodes.
Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated.
function replaceChildren(nodes: (string | Node)[])
Parameters
- nodes
-
(string | Node)[]
Inherited From ParentNode.replaceChildren