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
ATTRIBUTE_NODE
CDATA_SECTION_NODE
node is a CDATASection node.
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
HTMLElement
Type declaration
constructor: function
Returns HTMLElement
prototype: HTMLElement
NOTATION_NODE
PROCESSING_INSTRUCTION_NODE
node is a ProcessingInstruction node.
TEXT_NODE
node is a Text node.
accessKey
accessKeyLabel
align
assignedSlot
attributes
autocapitalize
baseURI
Returns node's node document's document base URL.
childElementCount
childNodes
Returns the children.
children
Returns the child elements.
classList
Allows for manipulation of element's class content attribute as a set of whitespace-separated tokens through a DOMTokenList object.
className
Returns the value of element's class content attribute. Can be set to change it.
clientHeight
clientLeft
clientTop
clientWidth
contentEditable
dataset
dir
draggable
firstChild
Returns the first child.
firstElementChild
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.
innerHTML
innerText
inputMode
isConnected
Returns true if node is connected and false otherwise.
isContentEditable
lang
lastChild
Returns the last child.
lastElementChild
Returns the last child that is an element, and null otherwise.
localName
Returns the local name.
namespaceURI
Returns the namespace.
nextElementSibling
Returns the first following sibling that is an element, and null otherwise.
nextSibling
Returns the next sibling.
nodeName
Returns a string appropriate for the type of node.
nodeType
Returns the type of node.
nodeValue
Optional nonce
offsetHeight
offsetLeft
offsetParent
offsetTop
offsetWidth
onabort
Fires when the user aborts the download.
The event.
onanimationcancel
onanimationend
onanimationiteration
onanimationstart
onauxclick
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.
ondragexit
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.
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.
onloadend
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
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
ontouchcancel
ontouchend
ontouchmove
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.
onwheel
outerHTML
ownerDocument
Returns the node document. Returns null for documents.
parentElement
Returns the parent element.
parentNode
Returns the parent.
prefix
Returns the namespace prefix.
previousElementSibling
Returns the first preceding sibling that is an element, and null otherwise.
previousSibling
Returns the previous sibling.
scrollHeight
scrollLeft
scrollTop
scrollWidth
shadowRoot
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
style
tabIndex
tagName
Returns the HTML-uppercased qualified name.
textContent
title
translate
Methods
addEventListener
Type parameters
K: keyof HTMLElementEventMap
Parameters
type: K
listener: (this: HTMLDivElement, ev: HTMLElementEventMap[K]) => any
Parameters
this: 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 | Node)[]
Returns void
animate
Parameters
keyframes: Keyframe[] | PropertyIndexedKeyframes | null
Optional options: number | KeyframeAnimationOptions
Returns 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 | Node)[]
Returns void
appendChild
Type parameters
T: Node
Parameters
newChild: T
Returns T
attachShadow
Creates a shadow root for element and returns it.
Parameters
init: ShadowRootInit
Returns 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 | Node)[]
Returns void
blur
Returns void
click
Returns void
cloneNode
Returns a copy of node. If deep is true, the copy also includes the node's descendants.
Parameters
Optional deep: undefined | false | true
Returns Node
closest
Returns the first (starting at element) inclusive ancestor that matches selectors, and null otherwise.
Type parameters
K: keyof HTMLElementTagNameMap
Parameters
selector: K
Returns HTMLElementTagNameMap[K] | null
Type parameters
K: keyof SVGElementTagNameMap
Parameters
selector: K
Returns SVGElementTagNameMap[K] | null
Type parameters
E: Element
Parameters
selector: string
Returns E | null
compareDocumentPosition
Returns a bitmask indicating the position of other relative to node.
Parameters
other: Node
Returns number
contains
Returns true if other is an inclusive descendant of node, and false otherwise.
Parameters
other: Node | null
Returns boolean
dispatchEvent
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
getAnimations
Returns Animation[]
getAttribute
Returns element's first attribute whose qualified name is qualifiedName, and null if there is no such attribute otherwise.
Parameters
qualifiedName: string
Returns string | null
getAttributeNS
Returns element's attribute whose namespace is namespace and local name is localName, and null if there is no such attribute otherwise.
Parameters
namespace: string | null
localName: string
Returns string | null
getAttributeNames
Returns the qualified names of all element's attributes. Can contain duplicates.
Returns string[]
getAttributeNode
Parameters
name: string
Returns Attr | null
getAttributeNodeNS
Parameters
namespaceURI: string
localName: string
Returns Attr | null
getBoundingClientRect
Returns DOMRect
getClientRects
Returns DOMRectList
getElementsByClassName
Returns a HTMLCollection of the elements in the object on which the method was invoked (a document or an element) that have all the classes given by classNames. The classNames argument is interpreted as a space-separated list of classes.
Parameters
classNames: string
Returns HTMLCollectionOf<Element>
getElementsByTagName
Type parameters
K: keyof HTMLElementTagNameMap
Parameters
qualifiedName: K
Returns HTMLCollectionOf<HTMLElementTagNameMap[K]>
Type parameters
K: keyof SVGElementTagNameMap
Parameters
qualifiedName: K
Returns HTMLCollectionOf<SVGElementTagNameMap[K]>
Parameters
qualifiedName: string
Returns HTMLCollectionOf<Element>
getElementsByTagNameNS
Parameters
namespaceURI: "http://www.w3.org/1999/xhtml"
localName: string
Returns HTMLCollectionOf<HTMLElement>
Parameters
namespaceURI: "http://www.w3.org/2000/svg"
localName: string
Returns HTMLCollectionOf<SVGElement>
Parameters
namespaceURI: string
localName: string
Returns HTMLCollectionOf<Element>
getRootNode
Returns node's root.
Parameters
Optional options: GetRootNodeOptions
Returns Node
hasAttribute
Returns true if element has an attribute whose qualified name is qualifiedName, and false otherwise.
Parameters
qualifiedName: string
Returns boolean
hasAttributeNS
Returns true if element has an attribute whose namespace is namespace and local name is localName.
Parameters
namespace: string | null
localName: string
Returns boolean
hasAttributes
Returns true if element has attributes, and false otherwise.
Returns boolean
hasChildNodes
Returns whether node has children.
Returns boolean
hasPointerCapture
Parameters
pointerId: number
Returns boolean
insertAdjacentElement
Parameters
position: InsertPosition
insertedElement: Element
Returns Element | null
insertAdjacentHTML
Parameters
where: InsertPosition
html: string
Returns void
insertAdjacentText
Parameters
where: InsertPosition
text: string
Returns void
insertBefore
Type parameters
T: Node
Parameters
newChild: T
refChild: Node | null
Returns T
isDefaultNamespace
Parameters
namespace: string | null
Returns boolean
isEqualNode
Returns whether node and otherNode have the same properties.
Parameters
otherNode: Node | null
Returns boolean
isSameNode
Parameters
otherNode: Node | null
Returns boolean
lookupNamespaceURI
Parameters
prefix: string | null
Returns string | null
lookupPrefix
Parameters
namespace: string | null
Returns string | null
matches
Returns true if matching selectors against element's root yields element, and false otherwise.
Parameters
selectors: string
Returns boolean
msGetRegionContent
Returns any
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 | Node)[]
Returns void
querySelector
Returns the first element that is a descendant of node that matches selectors.
Type parameters
K: keyof HTMLElementTagNameMap
Parameters
selectors: K
Returns HTMLElementTagNameMap[K] | null
Type parameters
K: keyof SVGElementTagNameMap
Parameters
selectors: K
Returns SVGElementTagNameMap[K] | null
Type parameters
E: Element
Parameters
selectors: string
Returns E | null
querySelectorAll
Returns all element descendants of node that match selectors.
Type parameters
K: keyof HTMLElementTagNameMap
Parameters
selectors: K
Returns NodeListOf<HTMLElementTagNameMap[K]>
Type parameters
K: keyof SVGElementTagNameMap
Parameters
selectors: K
Returns NodeListOf<SVGElementTagNameMap[K]>
Type parameters
E: Element
Parameters
selectors: string
Returns NodeListOf<E>
releasePointerCapture
Parameters
pointerId: number
Returns void
remove
Removes node.
Returns void
removeAttribute
Removes element's first attribute whose qualified name is qualifiedName.
Parameters
qualifiedName: string
Returns void
removeAttributeNS
Removes element's attribute whose namespace is namespace and local name is localName.
Parameters
namespace: string | null
localName: string
Returns void
removeAttributeNode
Parameters
attr: Attr
Returns Attr
removeChild
Type parameters
T: Node
Parameters
oldChild: T
Returns T
removeEventListener
Type parameters
K: keyof HTMLElementEventMap
Parameters
type: K
listener: (this: HTMLDivElement, ev: HTMLElementEventMap[K]) => any
Parameters
this: HTMLDivElement
ev: HTMLElementEventMap[K]
Returns any
Optional options: boolean | EventListenerOptions
Returns void
Parameters
type: string
listener: EventListenerOrEventListenerObject
Optional options: boolean | EventListenerOptions
Returns void
replaceChild
Type parameters
T: Node
Parameters
newChild: Node
oldChild: T
Returns T
replaceWith
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 | Node)[]
Returns void
requestFullscreen
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>
requestPointerLock
Returns void
scroll
Parameters
Optional options: ScrollToOptions
Returns void
Parameters
x: number
y: number
Returns void
scrollBy
Parameters
Optional options: ScrollToOptions
Returns void
Parameters
x: number
y: number
Returns void
scrollIntoView
Parameters
Optional arg: boolean | ScrollIntoViewOptions
Returns void
scrollTo
Parameters
Optional options: ScrollToOptions
Returns void
Parameters
x: number
y: number
Returns void
setAttribute
Sets the value of element's first attribute whose qualified name is qualifiedName to value.
Parameters
qualifiedName: string
value: string
Returns void
setAttributeNS
Sets the value of element's attribute whose namespace is namespace and local name is localName to value.
Parameters
namespace: string | null
qualifiedName: string
value: string
Returns void
setAttributeNode
Parameters
attr: Attr
Returns Attr | null
setAttributeNodeNS
Parameters
attr: Attr
Returns Attr | null
setPointerCapture
Parameters
pointerId: number
Returns void
toggleAttribute
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: undefined | false | true
Returns boolean
webkitMatchesSelector
Parameters
selectors: string
Returns boolean