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.
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.
Displays element fullscreen and resolves promise when done.
When supplied, options's navigationUI member indicates whether showing navigation UI while in fullscreen is preferred or not. If set to "show", navigation simplicity is preferred over screen space, and if set to "hide", more screen space is preferred. User agents are always free to honor user preference over the application's. The default value "auto" indicates no application preference.
If force is not given, "toggles" qualifiedName, removing it if it is present and adding it if it is not present. If force is true, adds qualifiedName. If force is false, removes qualifiedName.
Returns true if qualifiedName is now present, and false otherwise.
Provides special properties (beyond the regular HTMLElement interface it also has available to it by inheritance) for manipulating
Hierarchy
Index
Properties
Methods
Properties
Readonly ATTRIBUTE_ NODE
Readonly CDATA_ SECTION_ NODE
node is a CDATASection node.
Readonly COMMENT_ NODE
node is a Comment node.
Readonly DOCUMENT_ FRAGMENT_ NODE
node is a DocumentFragment node.
Readonly DOCUMENT_ NODE
node is a document.
Readonly DOCUMENT_ POSITION_ CONTAINED_ BY
Set when other is a descendant of node.
Readonly DOCUMENT_ POSITION_ CONTAINS
Set when other is an ancestor of node.
Readonly DOCUMENT_ POSITION_ DISCONNECTED
Set when node and other are not in the same tree.
Readonly DOCUMENT_ POSITION_ FOLLOWING
Set when other is following node.
Readonly DOCUMENT_ POSITION_ IMPLEMENTATION_ SPECIFIC
Readonly DOCUMENT_ POSITION_ PRECEDING
Set when other is preceding node.
Readonly DOCUMENT_ TYPE_ NODE
node is a doctype.
Readonly ELEMENT_ NODE
node is an element.
Readonly ENTITY_ NODE
Readonly ENTITY_ REFERENCE_ NODE
Readonly NOTATION_ NODE
Readonly PROCESSING_ INSTRUCTION_ NODE
node is a ProcessingInstruction node.
Readonly TEXT_ NODE
node is a Text node.
access Key
Readonly access Key Label
align
Sets or retrieves how the object is aligned with adjacent text.
aria Atomic
aria Auto Complete
aria Busy
aria Checked
aria Col Count
aria Col Index
aria Col Index Text
aria Col Span
aria Current
aria Disabled
aria Expanded
aria Has Popup
aria Hidden
aria Invalid
aria Key Shortcuts
aria Label
aria Level
aria Live
aria Modal
aria Multi Line
aria Multi Selectable
aria Orientation
aria Placeholder
aria Pos In Set
aria Pressed
aria Read Only
aria Required
aria Role Description
aria Row Count
aria Row Index
aria Row Index Text
aria Row Span
aria Selected
aria Set Size
aria Sort
aria Value Max
aria Value Min
aria Value Now
aria Value Text
Readonly assigned Slot
Readonly attributes
autocapitalize
autofocus
Readonly baseURI
Returns node's node document's document base URL.
Readonly child Element Count
Readonly child Nodes
Returns the children.
Readonly children
Returns the child elements.
Readonly class List
Allows for manipulation of element's class content attribute as a set of whitespace-separated tokens through a DOMTokenList object.
class Name
Returns the value of element's class content attribute. Can be set to change it.
Readonly client Height
Readonly client Left
Readonly client Top
Readonly client Width
content Editable
Readonly dataset
dir
draggable
enter Key Hint
Readonly first Child
Returns the first child.
Readonly first Element Child
Returns the first child that is an element, and null otherwise.
hidden
id
Returns the value of element's id content attribute. Can be set to change it.
inert
innerHTML
inner Text
input Mode
Readonly is Connected
Returns true if node is connected and false otherwise.
Readonly is Content Editable
lang
Readonly last Child
Returns the last child.
Readonly last Element Child
Returns the last child that is an element, and null otherwise.
Readonly local Name
Returns the local name.
Readonly namespaceURI
Returns the namespace.
Readonly next Element Sibling
Returns the first following sibling that is an element, and null otherwise.
Readonly next Sibling
Returns the next sibling.
Readonly node Name
Returns a string appropriate for the type of node.
Readonly node Type
Returns the type of node.
node Value
Optional nonce
Readonly offset Height
Readonly offset Left
Readonly offset Parent
Readonly offset Top
Readonly offset Width
onabort
Fires when the user aborts the download.
The event.
onanimationcancel
onanimationend
onanimationiteration
onanimationstart
onauxclick
onbeforeinput
onblur
Fires when the object loses the input focus.
The focus event.
oncancel
oncanplay
Occurs when playback is possible, but would require further buffering.
The event.
oncanplaythrough
onchange
Fires when the contents of the object or selection have changed.
The event.
onclick
Fires when the user clicks the left mouse button on the object
The mouse event.
onclose
oncontextmenu
Fires when the user clicks the right mouse button in the client area, opening the context menu.
The mouse event.
oncopy
oncuechange
oncut
ondblclick
Fires when the user double-clicks the object.
The mouse event.
ondrag
Fires on the source object continuously during a drag operation.
The event.
ondragend
Fires on the source object when the user releases the mouse at the close of a drag operation.
The event.
ondragenter
Fires on the target element when the user drags the object to a valid drop target.
The drag event.
ondragleave
Fires on the target object when the user moves the mouse out of a valid drop target during a drag operation.
The drag event.
ondragover
Fires on the target element continuously while the user drags the object over a valid drop target.
The event.
ondragstart
Fires on the source object when the user starts to drag a text selection or selected object.
The event.
ondrop
ondurationchange
Occurs when the duration attribute is updated.
The event.
onemptied
Occurs when the media element is reset to its initial state.
The event.
onended
Occurs when the end of playback is reached.
The event
onerror
Fires when an error occurs during object loading.
The event.
onfocus
Fires when the object receives focus.
The event.
onformdata
onfullscreenchange
onfullscreenerror
ongotpointercapture
oninput
oninvalid
onkeydown
Fires when the user presses a key.
The keyboard event
onkeypress
Fires when the user presses an alphanumeric key.
The event.
onkeyup
Fires when the user releases a key.
The keyboard event
onload
Fires immediately after the browser loads the object.
The event.
onloadeddata
Occurs when media data is loaded at the current playback position.
The event.
onloadedmetadata
Occurs when the duration and dimensions of the media have been determined.
The event.
onloadstart
Occurs when Internet Explorer begins looking for media data.
The event.
onlostpointercapture
onmousedown
Fires when the user clicks the object with either mouse button.
The mouse event.
onmouseenter
onmouseleave
onmousemove
Fires when the user moves the mouse over the object.
The mouse event.
onmouseout
Fires when the user moves the mouse pointer outside the boundaries of the object.
The mouse event.
onmouseover
Fires when the user moves the mouse pointer into the object.
The mouse event.
onmouseup
Fires when the user releases a mouse button while the mouse is over the object.
The mouse event.
onpaste
onpause
Occurs when playback is paused.
The event.
onplay
Occurs when the play method is requested.
The event.
onplaying
Occurs when the audio or video has started playing.
The event.
onpointercancel
onpointerdown
onpointerenter
onpointerleave
onpointermove
onpointerout
onpointerover
onpointerup
onprogress
Occurs to indicate progress while downloading media data.
The event.
onratechange
Occurs when the playback rate is increased or decreased.
The event.
onreset
Fires when the user resets a form.
The event.
onresize
onscroll
Fires when the user repositions the scroll box in the scroll bar on the object.
The event.
onsecuritypolicyviolation
onseeked
Occurs when the seek operation ends.
The event.
onseeking
Occurs when the current playback position is moved.
The event.
onselect
Fires when the current selection changes.
The event.
onselectionchange
onselectstart
onslotchange
onstalled
Occurs when the download has stopped.
The event.
onsubmit
onsuspend
Occurs if the load operation has been intentionally halted.
The event.
ontimeupdate
Occurs to indicate the current playback position.
The event.
ontoggle
Optional ontouchcancel
Optional ontouchend
Optional ontouchmove
Optional ontouchstart
ontransitioncancel
ontransitionend
ontransitionrun
ontransitionstart
onvolumechange
Occurs when the volume is changed, or playback is muted or unmuted.
The event.
onwaiting
Occurs when playback stops because the next frame of a video resource is not available.
The event.
onwebkitanimationend
This is a legacy alias of
onanimationend
.onwebkitanimationiteration
This is a legacy alias of
onanimationiteration
.onwebkitanimationstart
This is a legacy alias of
onanimationstart
.onwebkittransitionend
This is a legacy alias of
ontransitionend
.onwheel
outerHTML
outer Text
Readonly owner Document
Readonly parent Element
Returns the parent element.
Readonly parent Node
Returns the parent.
Readonly part
Readonly prefix
Returns the namespace prefix.
Readonly previous Element Sibling
Returns the first preceding sibling that is an element, and null otherwise.
Readonly previous Sibling
Returns the previous sibling.
role
Readonly scroll Height
scroll Left
scroll Top
Readonly scroll Width
Readonly shadow Root
Returns element's shadow root, if any, and if shadow root's mode is "open", and null otherwise.
slot
Returns the value of element's slot content attribute. Can be set to change it.
spellcheck
Readonly style
tab Index
Readonly tag Name
Returns the HTML-uppercased qualified name.
text Content
title
translate
Methods
add Event Listener
Type Parameters
K extends keyof HTMLElementEventMap
Parameters
type: K
listener: ((this: internal.HTMLDivElement, ev: HTMLElementEventMap[K]) => any)
Parameters
this: internal.HTMLDivElement
ev: HTMLElementEventMap[K]
Returns any
Optional options: boolean | AddEventListenerOptions
Returns void
Parameters
type: string
listener: EventListenerOrEventListenerObject
Optional options: boolean | AddEventListenerOptions
Returns void
after
Inserts nodes just after 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 | internal.Node)[]
Returns void
animate
Parameters
keyframes: null | Keyframe[] | PropertyIndexedKeyframes
Optional options: number | KeyframeAnimationOptions
Returns internal.Animation
append
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 | internal.Node)[]
Returns void
append Child
Type Parameters
T extends internal.Node<T>
Parameters
node: T
Returns T
attach Internals
Returns internal.ElementInternals
attach Shadow
Creates a shadow root for element and returns it.
Parameters
init: ShadowRootInit
Returns internal.ShadowRoot
before
Inserts nodes just before 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 | internal.Node)[]
Returns void
blur
Returns void
click
Returns void
clone Node
Returns a copy of node. If deep is true, the copy also includes the node's descendants.
Parameters
Optional deep: boolean
Returns internal.Node
closest
Returns the first (starting at element) inclusive ancestor that matches selectors, and null otherwise.
Type Parameters
K extends keyof HTMLElementTagNameMap
Parameters
selector: K
Returns null | HTMLElementTagNameMap[K]
Type Parameters
K extends keyof SVGElementTagNameMap
Parameters
selector: K
Returns null | SVGElementTagNameMap[K]
Type Parameters
E extends internal.Element<E> = internal.Element
Parameters
selectors: string
Returns null | E
compare Document Position
Returns a bitmask indicating the position of other relative to node.
Parameters
other: internal.Node
Returns number
contains
Returns true if other is an inclusive descendant of node, and false otherwise.
Parameters
other: null | internal.Node
Returns boolean
dispatch Event
Dispatches a synthetic event event to target and returns true if either event's cancelable attribute value is false or its preventDefault() method was not invoked, and false otherwise.
Parameters
event: Event
Returns boolean
focus
Parameters
Optional options: FocusOptions
Returns void
get Animations
Parameters
Optional options: GetAnimationsOptions
Returns internal.Animation[]
get Attribute
Returns element's first attribute whose qualified name is qualifiedName, and null if there is no such attribute otherwise.
Parameters
qualifiedName: string
Returns null | string
get AttributeNS
Returns element's attribute whose namespace is namespace and local name is localName, and null if there is no such attribute otherwise.
Parameters
namespace: null | string
localName: string
Returns null | string
get Attribute Names
Returns the qualified names of all element's attributes. Can contain duplicates.
Returns string[]
get Attribute Node
Parameters
qualifiedName: string
Returns null | internal.Attr
get Attribute NodeNS
Parameters
namespace: null | string
localName: string
Returns null | internal.Attr
get Bounding Client Rect
Returns internal.DOMRect
get Client Rects
Returns internal.DOMRectList
get Elements By Class Name
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<internal.Element>
get Elements By Tag Name
Type Parameters
K extends keyof HTMLElementTagNameMap
Parameters
qualifiedName: K
Returns HTMLCollectionOf<HTMLElementTagNameMap[K]>
Type Parameters
K extends keyof SVGElementTagNameMap
Parameters
qualifiedName: K
Returns HTMLCollectionOf<SVGElementTagNameMap[K]>
Parameters
qualifiedName: string
Returns HTMLCollectionOf<internal.Element>
get Elements By Tag NameNS
Parameters
namespaceURI: "http://www.w3.org/1999/xhtml"
localName: string
Returns HTMLCollectionOf<internal.HTMLElement>
Parameters
namespaceURI: "http://www.w3.org/2000/svg"
localName: string
Returns HTMLCollectionOf<internal.SVGElement>
Parameters
namespace: null | string
localName: string
Returns HTMLCollectionOf<internal.Element>
get Root Node
Returns node's root.
Parameters
Optional options: GetRootNodeOptions
Returns internal.Node
has Attribute
Returns true if element has an attribute whose qualified name is qualifiedName, and false otherwise.
Parameters
qualifiedName: string
Returns boolean
has AttributeNS
Returns true if element has an attribute whose namespace is namespace and local name is localName.
Parameters
namespace: null | string
localName: string
Returns boolean
has Attributes
Returns true if element has attributes, and false otherwise.
Returns boolean
has Child Nodes
Returns whether node has children.
Returns boolean
has Pointer Capture
Parameters
pointerId: number
Returns boolean
insert Adjacent Element
Parameters
where: InsertPosition
element: internal.Element
Returns null | internal.Element
insert AdjacentHTML
Parameters
position: InsertPosition
text: string
Returns void
insert Adjacent Text
Parameters
where: InsertPosition
data: string
Returns void
insert Before
Type Parameters
T extends internal.Node<T>
Parameters
node: T
child: null | internal.Node
Returns T
is Default Namespace
Parameters
namespace: null | string
Returns boolean
is Equal Node
Returns whether node and otherNode have the same properties.
Parameters
otherNode: null | internal.Node
Returns boolean
is Same Node
Parameters
otherNode: null | internal.Node
Returns boolean
lookup NamespaceURI
Parameters
prefix: null | string
Returns null | string
lookup Prefix
Parameters
namespace: null | string
Returns null | string
matches
Returns true if matching selectors against element's root yields element, and false otherwise.
Parameters
selectors: string
Returns boolean
normalize
Removes empty exclusive Text nodes and concatenates the data of remaining contiguous exclusive Text nodes into the first of their nodes.
Returns void
prepend
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 | internal.Node)[]
Returns void
query Selector
Returns the first element that is a descendant of node that matches selectors.
Type Parameters
K extends keyof HTMLElementTagNameMap
Parameters
selectors: K
Returns null | HTMLElementTagNameMap[K]
Type Parameters
K extends keyof SVGElementTagNameMap
Parameters
selectors: K
Returns null | SVGElementTagNameMap[K]
Type Parameters
E extends internal.Element<E> = internal.Element
Parameters
selectors: string
Returns null | E
query Selector All
Returns all element descendants of node that match selectors.
Type Parameters
K extends keyof HTMLElementTagNameMap
Parameters
selectors: K
Returns NodeListOf<HTMLElementTagNameMap[K]>
Type Parameters
K extends keyof SVGElementTagNameMap
Parameters
selectors: K
Returns NodeListOf<SVGElementTagNameMap[K]>
Type Parameters
E extends internal.Element<E> = internal.Element
Parameters
selectors: string
Returns NodeListOf<E>
release Pointer Capture
Parameters
pointerId: number
Returns void
remove
Removes node.
Returns void
remove Attribute
Removes element's first attribute whose qualified name is qualifiedName.
Parameters
qualifiedName: string
Returns void
remove AttributeNS
Removes element's attribute whose namespace is namespace and local name is localName.
Parameters
namespace: null | string
localName: string
Returns void
remove Attribute Node
Parameters
attr: internal.Attr
Returns internal.Attr
remove Child
Type Parameters
T extends internal.Node<T>
Parameters
child: T
Returns T
remove Event Listener
Type Parameters
K extends keyof HTMLElementEventMap
Parameters
type: K
listener: ((this: internal.HTMLDivElement, ev: HTMLElementEventMap[K]) => any)
Parameters
this: internal.HTMLDivElement
ev: HTMLElementEventMap[K]
Returns any
Optional options: boolean | EventListenerOptions
Returns void
Parameters
type: string
listener: EventListenerOrEventListenerObject
Optional options: boolean | EventListenerOptions
Returns void
replace Child
Type Parameters
T extends internal.Node<T>
Parameters
node: internal.Node
child: T
Returns T
replace Children
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.
Parameters
Rest ...nodes: (string | internal.Node)[]
Returns void
replace With
Replaces 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.
Parameters
Rest ...nodes: (string | internal.Node)[]
Returns void
request Fullscreen
Displays element fullscreen and resolves promise when done.
When supplied, options's navigationUI member indicates whether showing navigation UI while in fullscreen is preferred or not. If set to "show", navigation simplicity is preferred over screen space, and if set to "hide", more screen space is preferred. User agents are always free to honor user preference over the application's. The default value "auto" indicates no application preference.
Parameters
Optional options: FullscreenOptions
Returns Promise<void>
request Pointer Lock
Returns void
scroll
Parameters
Optional options: ScrollToOptions
Returns void
Parameters
x: number
y: number
Returns void
scroll By
Parameters
Optional options: ScrollToOptions
Returns void
Parameters
x: number
y: number
Returns void
scroll Into View
Parameters
Optional arg: boolean | ScrollIntoViewOptions
Returns void
scroll To
Parameters
Optional options: ScrollToOptions
Returns void
Parameters
x: number
y: number
Returns void
set Attribute
Sets the value of element's first attribute whose qualified name is qualifiedName to value.
Parameters
qualifiedName: string
value: string
Returns void
set AttributeNS
Sets the value of element's attribute whose namespace is namespace and local name is localName to value.
Parameters
namespace: null | string
qualifiedName: string
value: string
Returns void
set Attribute Node
Parameters
attr: internal.Attr
Returns null | internal.Attr
set Attribute NodeNS
Parameters
attr: internal.Attr
Returns null | internal.Attr
set Pointer Capture
Parameters
pointerId: number
Returns void
toggle Attribute
If force is not given, "toggles" qualifiedName, removing it if it is present and adding it if it is not present. If force is true, adds qualifiedName. If force is false, removes qualifiedName.
Returns true if qualifiedName is now present, and false otherwise.
Parameters
qualifiedName: string
Optional force: boolean
Returns boolean
webkit Matches Selector
This is a legacy alias of
matches
.Parameters
selectors: string
Returns boolean