A wrapper around a plain canvas
The idea is to shield the user from the weird semantics of changing width and height of a canvas by making this a opaque block element instead and managing the internal render resolution of the canvas dynamically
Extends#
HTMLElement
Methods#
clear()#
clear(): void;
Clear the canvas
This is useful when mounting the canvas into a new position in the DOM. If the canvas is not cleared, it will appear in the new DOM position, with its contents stretched to the new size. It will re-render correctly during the next animation frame, but for a brief moment the canvas contents can flash distorted.
Call clear()
before mounting into the DOM to avoid this. This will cause
the canvas to be cleared until rendering the next frame.
Returns#
void
animate()#
animate(keyframes, options?): Animation;
Parameters#
Parameter | Type |
---|---|
keyframes | null |
options? | number |
Returns#
Animation
Inherited from#
HTMLElement.animate
getAnimations()#
getAnimations(options?): Animation[];
Parameters#
Parameter | Type |
---|---|
options? | GetAnimationsOptions |
Returns#
Animation
[]
Inherited from#
HTMLElement.getAnimations
after()#
after(...nodes): void;
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.
MDN ReferenceParameters#
Parameter | Type |
---|---|
…nodes | (string |
Returns#
void
Inherited from#
HTMLElement.after
before()#
before(...nodes): void;
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.
MDN ReferenceParameters#
Parameter | Type |
---|---|
…nodes | (string |
Returns#
void
Inherited from#
HTMLElement.before
remove()#
remove(): void;
Removes node.
MDN ReferenceReturns#
void
Inherited from#
HTMLElement.remove
replaceWith()#
replaceWith(...nodes): void;
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.
MDN ReferenceParameters#
Parameter | Type |
---|---|
…nodes | (string |
Returns#
void
Inherited from#
HTMLElement.replaceWith
attachShadow()#
attachShadow(init): ShadowRoot;
Creates a shadow root for element and returns it.
MDN ReferenceParameters#
Parameter | Type |
---|---|
init | ShadowRootInit |
Returns#
ShadowRoot
Inherited from#
HTMLElement.attachShadow
checkVisibility()#
checkVisibility(options?): boolean;
Parameters#
Parameter | Type |
---|---|
options? | CheckVisibilityOptions |
Returns#
boolean
Inherited from#
HTMLElement.checkVisibility
closest()#
Call Signature#
closest<K>(selector): null | HTMLElementTagNameMap[K];
Returns the first (starting at element) inclusive ancestor that matches selectors, and null otherwise.
MDN ReferenceType Parameters#
Type Parameter |
---|
K extends keyof HTMLElementTagNameMap |
Parameters#
Parameter | Type |
---|---|
selector | K |
Returns#
null
| HTMLElementTagNameMap
[K
]
Inherited from#
HTMLElement.closest
Call Signature#
closest<K>(selector): null | SVGElementTagNameMap[K];
Type Parameters#
Type Parameter |
---|
K extends keyof SVGElementTagNameMap |
Parameters#
Parameter | Type |
---|---|
selector | K |
Returns#
null
| SVGElementTagNameMap
[K
]
Inherited from#
HTMLElement.closest
Call Signature#
closest<K>(selector): null | MathMLElementTagNameMap[K];
Type Parameters#
Type Parameter |
---|
K extends keyof MathMLElementTagNameMap |
Parameters#
Parameter | Type |
---|---|
selector | K |
Returns#
null
| MathMLElementTagNameMap
[K
]
Inherited from#
HTMLElement.closest
Call Signature#
closest<E>(selectors): null | E;
Type Parameters#
Type Parameter | Default type |
---|---|
E extends Element | Element |
Parameters#
Parameter | Type |
---|---|
selectors | string |
Returns#
null
| E
Inherited from#
HTMLElement.closest
computedStyleMap()#
computedStyleMap(): StylePropertyMapReadOnly;
Returns#
StylePropertyMapReadOnly
Inherited from#
HTMLElement.computedStyleMap
getAttribute()#
getAttribute(qualifiedName): null | string;
Returns element’s first attribute whose qualified name is qualifiedName, and null if there is no such attribute otherwise.
MDN ReferenceParameters#
Parameter | Type |
---|---|
qualifiedName | string |
Returns#
null
| string
Inherited from#
HTMLElement.getAttribute
getAttributeNS()#
getAttributeNS(namespace, localName): null | string;
Returns element’s attribute whose namespace is namespace and local name is localName, and null if there is no such attribute otherwise.
MDN ReferenceParameters#
Parameter | Type |
---|---|
namespace | null |
localName | string |
Returns#
null
| string
Inherited from#
HTMLElement.getAttributeNS
getAttributeNames()#
getAttributeNames(): string[];
Returns the qualified names of all element’s attributes. Can contain duplicates.
MDN ReferenceReturns#
string
[]
Inherited from#
HTMLElement.getAttributeNames
getAttributeNode()#
getAttributeNode(qualifiedName): null | Attr;
Parameters#
Parameter | Type |
---|---|
qualifiedName | string |
Returns#
null
| Attr
Inherited from#
HTMLElement.getAttributeNode
getAttributeNodeNS()#
getAttributeNodeNS(namespace, localName): null | Attr;
Parameters#
Parameter | Type |
---|---|
namespace | null |
localName | string |
Returns#
null
| Attr
Inherited from#
HTMLElement.getAttributeNodeNS
getBoundingClientRect()#
getBoundingClientRect(): DOMRect;
Returns#
DOMRect
Inherited from#
HTMLElement.getBoundingClientRect
getClientRects()#
getClientRects(): DOMRectList;
Returns#
DOMRectList
Inherited from#
HTMLElement.getClientRects
getElementsByClassName()#
getElementsByClassName(classNames): HTMLCollectionOf<Element>;
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.
MDN ReferenceParameters#
Parameter | Type |
---|---|
classNames | string |
Returns#
HTMLCollectionOf
<Element
>
Inherited from#
HTMLElement.getElementsByClassName
getElementsByTagName()#
Call Signature#
getElementsByTagName<K>(qualifiedName): HTMLCollectionOf<HTMLElementTagNameMap[K]>;
Type Parameters#
Type Parameter |
---|
K extends keyof HTMLElementTagNameMap |
Parameters#
Parameter | Type |
---|---|
qualifiedName | K |
Returns#
HTMLCollectionOf
<HTMLElementTagNameMap
[K
]>
Inherited from#
HTMLElement.getElementsByTagName
Call Signature#
getElementsByTagName<K>(qualifiedName): HTMLCollectionOf<SVGElementTagNameMap[K]>;
Type Parameters#
Type Parameter |
---|
K extends keyof SVGElementTagNameMap |
Parameters#
Parameter | Type |
---|---|
qualifiedName | K |
Returns#
HTMLCollectionOf
<SVGElementTagNameMap
[K
]>
Inherited from#
HTMLElement.getElementsByTagName
Call Signature#
getElementsByTagName<K>(qualifiedName): HTMLCollectionOf<MathMLElementTagNameMap[K]>;
Type Parameters#
Type Parameter |
---|
K extends keyof MathMLElementTagNameMap |
Parameters#
Parameter | Type |
---|---|
qualifiedName | K |
Returns#
HTMLCollectionOf
<MathMLElementTagNameMap
[K
]>
Inherited from#
HTMLElement.getElementsByTagName
Call Signature#
getElementsByTagName<K>(qualifiedName): HTMLCollectionOf<HTMLElementDeprecatedTagNameMap[K]>;
Type Parameters#
Type Parameter |
---|
K extends keyof HTMLElementDeprecatedTagNameMap |
Parameters#
Parameter | Type |
---|---|
qualifiedName | K |
Returns#
HTMLCollectionOf
<HTMLElementDeprecatedTagNameMap
[K
]>
Deprecated#
Inherited from#
HTMLElement.getElementsByTagName
Call Signature#
getElementsByTagName(qualifiedName): HTMLCollectionOf<Element>;
Parameters#
Parameter | Type |
---|---|
qualifiedName | string |
Returns#
HTMLCollectionOf
<Element
>
Inherited from#
HTMLElement.getElementsByTagName
getElementsByTagNameNS()#
Call Signature#
getElementsByTagNameNS(namespaceURI, localName): HTMLCollectionOf<HTMLElement>;
Parameters#
Parameter | Type |
---|---|
namespaceURI | "http://www.w3.org/1999/xhtml" |
localName | string |
Returns#
HTMLCollectionOf
<HTMLElement
>
Inherited from#
HTMLElement.getElementsByTagNameNS
Call Signature#
getElementsByTagNameNS(namespaceURI, localName): HTMLCollectionOf<SVGElement>;
Parameters#
Parameter | Type |
---|---|
namespaceURI | "http://www.w3.org/2000/svg" |
localName | string |
Returns#
HTMLCollectionOf
<SVGElement
>
Inherited from#
HTMLElement.getElementsByTagNameNS
Call Signature#
getElementsByTagNameNS(namespaceURI, localName): HTMLCollectionOf<MathMLElement>;
Parameters#
Parameter | Type |
---|---|
namespaceURI | "http://www.w3.org/1998/Math/MathML" |
localName | string |
Returns#
HTMLCollectionOf
<MathMLElement
>
Inherited from#
HTMLElement.getElementsByTagNameNS
Call Signature#
getElementsByTagNameNS(namespace, localName): HTMLCollectionOf<Element>;
Parameters#
Parameter | Type |
---|---|
namespace | null |
localName | string |
Returns#
HTMLCollectionOf
<Element
>
Inherited from#
HTMLElement.getElementsByTagNameNS
getHTML()#
getHTML(options?): string;
Parameters#
Parameter | Type |
---|---|
options? | GetHTMLOptions |
Returns#
string
Inherited from#
HTMLElement.getHTML
hasAttribute()#
hasAttribute(qualifiedName): boolean;
Returns true if element has an attribute whose qualified name is qualifiedName, and false otherwise.
MDN ReferenceParameters#
Parameter | Type |
---|---|
qualifiedName | string |
Returns#
boolean
Inherited from#
HTMLElement.hasAttribute
hasAttributeNS()#
hasAttributeNS(namespace, localName): boolean;
Returns true if element has an attribute whose namespace is namespace and local name is localName.
MDN ReferenceParameters#
Parameter | Type |
---|---|
namespace | null |
localName | string |
Returns#
boolean
Inherited from#
HTMLElement.hasAttributeNS
hasAttributes()#
hasAttributes(): boolean;
Returns true if element has attributes, and false otherwise.
MDN ReferenceReturns#
boolean
Inherited from#
HTMLElement.hasAttributes
hasPointerCapture()#
hasPointerCapture(pointerId): boolean;
Parameters#
Parameter | Type |
---|---|
pointerId | number |
Returns#
boolean
Inherited from#
HTMLElement.hasPointerCapture
insertAdjacentElement()#
insertAdjacentElement(where, element): null | Element;
Parameters#
Parameter | Type |
---|---|
where | InsertPosition |
element | Element |
Returns#
null
| Element
Inherited from#
HTMLElement.insertAdjacentElement
insertAdjacentHTML()#
insertAdjacentHTML(position, string): void;
Parameters#
Parameter | Type |
---|---|
position | InsertPosition |
string | string |
Returns#
void
Inherited from#
HTMLElement.insertAdjacentHTML
insertAdjacentText()#
insertAdjacentText(where, data): void;
Parameters#
Parameter | Type |
---|---|
where | InsertPosition |
data | string |
Returns#
void
Inherited from#
HTMLElement.insertAdjacentText
matches()#
matches(selectors): boolean;
Returns true if matching selectors against element’s root yields element, and false otherwise.
MDN ReferenceParameters#
Parameter | Type |
---|---|
selectors | string |
Returns#
boolean
Inherited from#
HTMLElement.matches
releasePointerCapture()#
releasePointerCapture(pointerId): void;
Parameters#
Parameter | Type |
---|---|
pointerId | number |
Returns#
void
Inherited from#
HTMLElement.releasePointerCapture
removeAttribute()#
removeAttribute(qualifiedName): void;
Removes element’s first attribute whose qualified name is qualifiedName.
MDN ReferenceParameters#
Parameter | Type |
---|---|
qualifiedName | string |
Returns#
void
Inherited from#
HTMLElement.removeAttribute
removeAttributeNS()#
removeAttributeNS(namespace, localName): void;
Removes element’s attribute whose namespace is namespace and local name is localName.
MDN ReferenceParameters#
Parameter | Type |
---|---|
namespace | null |
localName | string |
Returns#
void
Inherited from#
HTMLElement.removeAttributeNS
removeAttributeNode()#
removeAttributeNode(attr): Attr;
Parameters#
Parameter | Type |
---|---|
attr | Attr |
Returns#
Attr
Inherited from#
HTMLElement.removeAttributeNode
requestFullscreen()#
requestFullscreen(options?): Promise<void>;
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.
MDN ReferenceParameters#
Parameter | Type |
---|---|
options? | FullscreenOptions |
Returns#
Promise
<void
>
Inherited from#
HTMLElement.requestFullscreen
requestPointerLock()#
requestPointerLock(options?): Promise<void>;
Parameters#
Parameter | Type |
---|---|
options? | PointerLockOptions |
Returns#
Promise
<void
>
Inherited from#
HTMLElement.requestPointerLock
scroll()#
Call Signature#
scroll(options?): void;
Parameters#
Parameter | Type |
---|---|
options? | ScrollToOptions |
Returns#
void
Inherited from#
HTMLElement.scroll
Call Signature#
scroll(x, y): void;
Parameters#
Parameter | Type |
---|---|
x | number |
y | number |
Returns#
void
Inherited from#
HTMLElement.scroll
scrollBy()#
Call Signature#
scrollBy(options?): void;
Parameters#
Parameter | Type |
---|---|
options? | ScrollToOptions |
Returns#
void
Inherited from#
HTMLElement.scrollBy
Call Signature#
scrollBy(x, y): void;
Parameters#
Parameter | Type |
---|---|
x | number |
y | number |
Returns#
void
Inherited from#
HTMLElement.scrollBy
scrollIntoView()#
scrollIntoView(arg?): void;
Parameters#
Parameter | Type |
---|---|
arg? | boolean |
Returns#
void
Inherited from#
HTMLElement.scrollIntoView
scrollTo()#
Call Signature#
scrollTo(options?): void;
Parameters#
Parameter | Type |
---|---|
options? | ScrollToOptions |
Returns#
void
Inherited from#
HTMLElement.scrollTo
Call Signature#
scrollTo(x, y): void;
Parameters#
Parameter | Type |
---|---|
x | number |
y | number |
Returns#
void
Inherited from#
HTMLElement.scrollTo
setAttribute()#
setAttribute(qualifiedName, value): void;
Sets the value of element’s first attribute whose qualified name is qualifiedName to value.
MDN ReferenceParameters#
Parameter | Type |
---|---|
qualifiedName | string |
value | string |
Returns#
void
Inherited from#
HTMLElement.setAttribute
setAttributeNS()#
setAttributeNS( namespace, qualifiedName, value): void;
Sets the value of element’s attribute whose namespace is namespace and local name is localName to value.
MDN ReferenceParameters#
Parameter | Type |
---|---|
namespace | null |
qualifiedName | string |
value | string |
Returns#
void
Inherited from#
HTMLElement.setAttributeNS
setAttributeNode()#
setAttributeNode(attr): null | Attr;
Parameters#
Parameter | Type |
---|---|
attr | Attr |
Returns#
null
| Attr
Inherited from#
HTMLElement.setAttributeNode
setAttributeNodeNS()#
setAttributeNodeNS(attr): null | Attr;
Parameters#
Parameter | Type |
---|---|
attr | Attr |
Returns#
null
| Attr
Inherited from#
HTMLElement.setAttributeNodeNS
setHTMLUnsafe()#
setHTMLUnsafe(html): void;
Parameters#
Parameter | Type |
---|---|
html | string |
Returns#
void
Inherited from#
HTMLElement.setHTMLUnsafe
setPointerCapture()#
setPointerCapture(pointerId): void;
Parameters#
Parameter | Type |
---|---|
pointerId | number |
Returns#
void
Inherited from#
HTMLElement.setPointerCapture
toggleAttribute()#
toggleAttribute(qualifiedName, force?): boolean;
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.
MDN ReferenceParameters#
Parameter | Type |
---|---|
qualifiedName | string |
force? | boolean |
Returns#
boolean
Inherited from#
HTMLElement.toggleAttribute
webkitMatchesSelector()#
webkitMatchesSelector(selectors): boolean;
Parameters#
Parameter | Type |
---|---|
selectors | string |
Returns#
boolean
Deprecated#
This is a legacy alias of matches
.
Inherited from#
HTMLElement.webkitMatchesSelector
dispatchEvent()#
dispatchEvent(event): boolean;
Dispatches a synthetic event event to target and returns true if either event’s cancelable attribute value is false or its preventDefault() method was not invoked, and false otherwise.
MDN ReferenceParameters#
Parameter | Type |
---|---|
event | Event |
Returns#
boolean
Inherited from#
HTMLElement.dispatchEvent
attachInternals()#
attachInternals(): ElementInternals;
Returns#
ElementInternals
Inherited from#
HTMLElement.attachInternals
click()#
click(): void;
Returns#
void
Inherited from#
HTMLElement.click
hidePopover()#
hidePopover(): void;
Returns#
void
Inherited from#
HTMLElement.hidePopover
showPopover()#
showPopover(): void;
Returns#
void
Inherited from#
HTMLElement.showPopover
togglePopover()#
togglePopover(force?): boolean;
Parameters#
Parameter | Type |
---|---|
force? | boolean |
Returns#
boolean
Inherited from#
HTMLElement.togglePopover
addEventListener()#
Call Signature#
addEventListener<K>( type, listener, options?): void;
Type Parameters#
Type Parameter |
---|
K extends keyof HTMLElementEventMap |
Parameters#
Parameter | Type |
---|---|
type | K |
listener | (this , ev ) => any |
options? | boolean |
Returns#
void
Inherited from#
HTMLElement.addEventListener
Call Signature#
addEventListener( type, listener, options?): void;
Parameters#
Parameter | Type |
---|---|
type | string |
listener | EventListenerOrEventListenerObject |
options? | boolean |
Returns#
void
Inherited from#
HTMLElement.addEventListener
removeEventListener()#
Call Signature#
removeEventListener<K>( type, listener, options?): void;
Type Parameters#
Type Parameter |
---|
K extends keyof HTMLElementEventMap |
Parameters#
Parameter | Type |
---|---|
type | K |
listener | (this , ev ) => any |
options? | boolean |
Returns#
void
Inherited from#
HTMLElement.removeEventListener
Call Signature#
removeEventListener( type, listener, options?): void;
Parameters#
Parameter | Type |
---|---|
type | string |
listener | EventListenerOrEventListenerObject |
options? | boolean |
Returns#
void
Inherited from#
HTMLElement.removeEventListener
blur()#
blur(): void;
Returns#
void
Inherited from#
HTMLElement.blur
focus()#
focus(options?): void;
Parameters#
Parameter | Type |
---|---|
options? | FocusOptions |
Returns#
void
Inherited from#
HTMLElement.focus
appendChild()#
appendChild<T>(node): T;
Type Parameters#
Type Parameter |
---|
T extends Node |
Parameters#
Parameter | Type |
---|---|
node | T |
Returns#
T
Inherited from#
HTMLElement.appendChild
cloneNode()#
cloneNode(deep?): Node;
Returns a copy of node. If deep is true, the copy also includes the node’s descendants.
MDN ReferenceParameters#
Parameter | Type |
---|---|
deep? | boolean |
Returns#
Node
Inherited from#
HTMLElement.cloneNode
compareDocumentPosition()#
compareDocumentPosition(other): number;
Returns a bitmask indicating the position of other relative to node.
MDN ReferenceParameters#
Parameter | Type |
---|---|
other | Node |
Returns#
number
Inherited from#
HTMLElement.compareDocumentPosition
contains()#
contains(other): boolean;
Returns true if other is an inclusive descendant of node, and false otherwise.
MDN ReferenceParameters#
Parameter | Type |
---|---|
other | null |
Returns#
boolean
Inherited from#
HTMLElement.contains
getRootNode()#
getRootNode(options?): Node;
Returns node’s root.
MDN ReferenceParameters#
Parameter | Type |
---|---|
options? | GetRootNodeOptions |
Returns#
Node
Inherited from#
HTMLElement.getRootNode
hasChildNodes()#
hasChildNodes(): boolean;
Returns whether node has children.
MDN ReferenceReturns#
boolean
Inherited from#
HTMLElement.hasChildNodes
insertBefore()#
insertBefore<T>(node, child): T;
Type Parameters#
Type Parameter |
---|
T extends Node |
Parameters#
Parameter | Type |
---|---|
node | T |
child | null |
Returns#
T
Inherited from#
HTMLElement.insertBefore
isDefaultNamespace()#
isDefaultNamespace(namespace): boolean;
Parameters#
Parameter | Type |
---|---|
namespace | null |
Returns#
boolean
Inherited from#
HTMLElement.isDefaultNamespace
isEqualNode()#
isEqualNode(otherNode): boolean;
Returns whether node and otherNode have the same properties.
MDN ReferenceParameters#
Parameter | Type |
---|---|
otherNode | null |
Returns#
boolean
Inherited from#
HTMLElement.isEqualNode
isSameNode()#
isSameNode(otherNode): boolean;
Parameters#
Parameter | Type |
---|---|
otherNode | null |
Returns#
boolean
Inherited from#
HTMLElement.isSameNode
lookupNamespaceURI()#
lookupNamespaceURI(prefix): null | string;
Parameters#
Parameter | Type |
---|---|
prefix | null |
Returns#
null
| string
Inherited from#
HTMLElement.lookupNamespaceURI
lookupPrefix()#
lookupPrefix(namespace): null | string;
Parameters#
Parameter | Type |
---|---|
namespace | null |
Returns#
null
| string
Inherited from#
HTMLElement.lookupPrefix
normalize()#
normalize(): void;
Removes empty exclusive Text nodes and concatenates the data of remaining contiguous exclusive Text nodes into the first of their nodes.
MDN ReferenceReturns#
void
Inherited from#
HTMLElement.normalize
removeChild()#
removeChild<T>(child): T;
Type Parameters#
Type Parameter |
---|
T extends Node |
Parameters#
Parameter | Type |
---|---|
child | T |
Returns#
T
Inherited from#
HTMLElement.removeChild
replaceChild()#
replaceChild<T>(node, child): T;
Type Parameters#
Type Parameter |
---|
T extends Node |
Parameters#
Parameter | Type |
---|---|
node | Node |
child | T |
Returns#
T
Inherited from#
HTMLElement.replaceChild
append()#
append(...nodes): void;
Inserts nodes after the last child of node, while replacing strings in nodes with equivalent Text nodes.
Throws a “HierarchyRequestError” DOMException if the constraints of the node tree are violated.
MDN ReferenceParameters#
Parameter | Type |
---|---|
…nodes | (string |
Returns#
void
Inherited from#
HTMLElement.append
prepend()#
prepend(...nodes): void;
Inserts nodes before the first child of node, while replacing strings in nodes with equivalent Text nodes.
Throws a “HierarchyRequestError” DOMException if the constraints of the node tree are violated.
MDN ReferenceParameters#
Parameter | Type |
---|---|
…nodes | (string |
Returns#
void
Inherited from#
HTMLElement.prepend
querySelector()#
Call Signature#
querySelector<K>(selectors): null | HTMLElementTagNameMap[K];
Returns the first element that is a descendant of node that matches selectors.
MDN ReferenceType Parameters#
Type Parameter |
---|
K extends keyof HTMLElementTagNameMap |
Parameters#
Parameter | Type |
---|---|
selectors | K |
Returns#
null
| HTMLElementTagNameMap
[K
]
Inherited from#
HTMLElement.querySelector
Call Signature#
querySelector<K>(selectors): null | SVGElementTagNameMap[K];
Type Parameters#
Type Parameter |
---|
K extends keyof SVGElementTagNameMap |
Parameters#
Parameter | Type |
---|---|
selectors | K |
Returns#
null
| SVGElementTagNameMap
[K
]
Inherited from#
HTMLElement.querySelector
Call Signature#
querySelector<K>(selectors): null | MathMLElementTagNameMap[K];
Type Parameters#
Type Parameter |
---|
K extends keyof MathMLElementTagNameMap |
Parameters#
Parameter | Type |
---|---|
selectors | K |
Returns#
null
| MathMLElementTagNameMap
[K
]
Inherited from#
HTMLElement.querySelector
Call Signature#
querySelector<K>(selectors): null | HTMLElementDeprecatedTagNameMap[K];
Type Parameters#
Type Parameter |
---|
K extends keyof HTMLElementDeprecatedTagNameMap |
Parameters#
Parameter | Type |
---|---|
selectors | K |
Returns#
null
| HTMLElementDeprecatedTagNameMap
[K
]
Deprecated#
Inherited from#
HTMLElement.querySelector
Call Signature#
querySelector<E>(selectors): null | E;
Type Parameters#
Type Parameter | Default type |
---|---|
E extends Element | Element |
Parameters#
Parameter | Type |
---|---|
selectors | string |
Returns#
null
| E
Inherited from#
HTMLElement.querySelector
querySelectorAll()#
Call Signature#
querySelectorAll<K>(selectors): NodeListOf<HTMLElementTagNameMap[K]>;
Returns all element descendants of node that match selectors.
MDN ReferenceType Parameters#
Type Parameter |
---|
K extends keyof HTMLElementTagNameMap |
Parameters#
Parameter | Type |
---|---|
selectors | K |
Returns#
NodeListOf
<HTMLElementTagNameMap
[K
]>
Inherited from#
HTMLElement.querySelectorAll
Call Signature#
querySelectorAll<K>(selectors): NodeListOf<SVGElementTagNameMap[K]>;
Type Parameters#
Type Parameter |
---|
K extends keyof SVGElementTagNameMap |
Parameters#
Parameter | Type |
---|---|
selectors | K |
Returns#
NodeListOf
<SVGElementTagNameMap
[K
]>
Inherited from#
HTMLElement.querySelectorAll
Call Signature#
querySelectorAll<K>(selectors): NodeListOf<MathMLElementTagNameMap[K]>;
Type Parameters#
Type Parameter |
---|
K extends keyof MathMLElementTagNameMap |
Parameters#
Parameter | Type |
---|---|
selectors | K |
Returns#
NodeListOf
<MathMLElementTagNameMap
[K
]>
Inherited from#
HTMLElement.querySelectorAll
Call Signature#
querySelectorAll<K>(selectors): NodeListOf<HTMLElementDeprecatedTagNameMap[K]>;
Type Parameters#
Type Parameter |
---|
K extends keyof HTMLElementDeprecatedTagNameMap |
Parameters#
Parameter | Type |
---|---|
selectors | K |
Returns#
NodeListOf
<HTMLElementDeprecatedTagNameMap
[K
]>
Deprecated#
Inherited from#
HTMLElement.querySelectorAll
Call Signature#
querySelectorAll<E>(selectors): NodeListOf<E>;
Type Parameters#
Type Parameter | Default type |
---|---|
E extends Element | Element |
Parameters#
Parameter | Type |
---|---|
selectors | string |
Returns#
NodeListOf
<E
>
Inherited from#
HTMLElement.querySelectorAll
replaceChildren()#
replaceChildren(...nodes): void;
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.
MDN ReferenceParameters#
Parameter | Type |
---|---|
…nodes | (string |
Returns#
void
Inherited from#
HTMLElement.replaceChildren
Properties#
Property | Modifier | Type | Description | Inherited from |
---|---|---|---|---|
ariaAtomic | public | null | string | MDN Reference |
ariaAutoComplete | public | null | string | MDN Reference |
ariaBrailleLabel | public | null | string | MDN Reference |
ariaBrailleRoleDescription | public | null | string | MDN Reference |
ariaBusy | public | null | string | MDN Reference |
ariaChecked | public | null | string | MDN Reference |
ariaColCount | public | null | string | MDN Reference |
ariaColIndex | public | null | string | MDN Reference |
ariaColSpan | public | null | string | MDN Reference |
ariaCurrent | public | null | string | MDN Reference |
ariaDescription | public | null | string | MDN Reference |
ariaDisabled | public | null | string | MDN Reference |
ariaExpanded | public | null | string | MDN Reference |
ariaHasPopup | public | null | string | MDN Reference |
ariaHidden | public | null | string | MDN Reference |
ariaInvalid | public | null | string | - |
ariaKeyShortcuts | public | null | string | MDN Reference |
ariaLabel | public | null | string | MDN Reference |
ariaLevel | public | null | string | MDN Reference |
ariaLive | public | null | string | MDN Reference |
ariaModal | public | null | string | MDN Reference |
ariaMultiLine | public | null | string | MDN Reference |
ariaMultiSelectable | public | null | string | MDN Reference |
ariaOrientation | public | null | string | MDN Reference |
ariaPlaceholder | public | null | string | MDN Reference |
ariaPosInSet | public | null | string | MDN Reference |
ariaPressed | public | null | string | MDN Reference |
ariaReadOnly | public | null | string | MDN Reference |
ariaRequired | public | null | string | MDN Reference |
ariaRoleDescription | public | null | string | MDN Reference |
ariaRowCount | public | null | string | MDN Reference |
ariaRowIndex | public | null | string | MDN Reference |
ariaRowSpan | public | null | string | MDN Reference |
ariaSelected | public | null | string | MDN Reference |
ariaSetSize | public | null | string | MDN Reference |
ariaSort | public | null | string | MDN Reference |
ariaValueMax | public | null | string | MDN Reference |
ariaValueMin | public | null | string | MDN Reference |
ariaValueNow | public | null | string | MDN Reference |
ariaValueText | public | null | string | MDN Reference |
role | public | null | string | - |
attributes | readonly | NamedNodeMap | MDN Reference | HTMLElement.attributes |
classList | readonly | DOMTokenList | Allows for manipulation of element’s class content attribute as a set of whitespace-separated tokens through a DOMTokenList object. MDN Reference | HTMLElement.classList |
className | public | string | Returns the value of element’s class content attribute. Can be set to change it. MDN Reference | HTMLElement.className |
clientHeight | readonly | number | MDN Reference | HTMLElement.clientHeight |
clientLeft | readonly | number | MDN Reference | HTMLElement.clientLeft |
clientTop | readonly | number | MDN Reference | HTMLElement.clientTop |
clientWidth | readonly | number | MDN Reference | HTMLElement.clientWidth |
id | public | string | Returns the value of element’s id content attribute. Can be set to change it. MDN Reference | HTMLElement.id |
innerHTML | public | string | MDN Reference | HTMLElement.innerHTML |
localName | readonly | string | Returns the local name. MDN Reference | HTMLElement.localName |
namespaceURI | readonly | null | string | Returns the namespace. MDN Reference |
onfullscreenchange | public | null | (this , ev ) => any | MDN Reference |
onfullscreenerror | public | null | (this , ev ) => any | MDN Reference |
outerHTML | public | string | MDN Reference | HTMLElement.outerHTML |
ownerDocument | readonly | Document | Returns the node document. Returns null for documents. MDN Reference | HTMLElement.ownerDocument |
part | readonly | DOMTokenList | MDN Reference | HTMLElement.part |
prefix | readonly | null | string | Returns the namespace prefix. MDN Reference |
scrollHeight | readonly | number | MDN Reference | HTMLElement.scrollHeight |
scrollLeft | public | number | MDN Reference | HTMLElement.scrollLeft |
scrollTop | public | number | MDN Reference | HTMLElement.scrollTop |
scrollWidth | readonly | number | MDN Reference | HTMLElement.scrollWidth |
shadowRoot | readonly | null | ShadowRoot | Returns element’s shadow root, if any, and if shadow root’s mode is “open”, and null otherwise. MDN Reference |
slot | public | string | Returns the value of element’s slot content attribute. Can be set to change it. MDN Reference | HTMLElement.slot |
tagName | readonly | string | Returns the HTML-uppercased qualified name. MDN Reference | HTMLElement.tagName |
attributeStyleMap | readonly | StylePropertyMap | MDN Reference | HTMLElement.attributeStyleMap |
style | readonly | CSSStyleDeclaration | MDN Reference | HTMLElement.style |
contentEditable | public | string | MDN Reference | HTMLElement.contentEditable |
enterKeyHint | public | string | MDN Reference | HTMLElement.enterKeyHint |
inputMode | public | string | MDN Reference | HTMLElement.inputMode |
isContentEditable | readonly | boolean | MDN Reference | HTMLElement.isContentEditable |
onabort | public | null | (this , ev ) => any | Fires when the user aborts the download. Param The event. MDN Reference |
onanimationcancel | public | null | (this , ev ) => any | MDN Reference |
onanimationend | public | null | (this , ev ) => any | MDN Reference |
onanimationiteration | public | null | (this , ev ) => any | MDN Reference |
onanimationstart | public | null | (this , ev ) => any | MDN Reference |
onauxclick | public | null | (this , ev ) => any | MDN Reference |
onbeforeinput | public | null | (this , ev ) => any | MDN Reference |
onbeforetoggle | public | null | (this , ev ) => any | MDN Reference |
onblur | public | null | (this , ev ) => any | Fires when the object loses the input focus. Param The focus event. MDN Reference |
oncancel | public | null | (this , ev ) => any | MDN Reference |
oncanplay | public | null | (this , ev ) => any | Occurs when playback is possible, but would require further buffering. Param The event. MDN Reference |
oncanplaythrough | public | null | (this , ev ) => any | MDN Reference |
onchange | public | null | (this , ev ) => any | Fires when the contents of the object or selection have changed. Param The event. MDN Reference |
onclick | public | null | (this , ev ) => any | Fires when the user clicks the left mouse button on the object Param The mouse event. MDN Reference |
onclose | public | null | (this , ev ) => any | MDN Reference |
oncontextlost | public | null | (this , ev ) => any | MDN Reference |
oncontextmenu | public | null | (this , ev ) => any | Fires when the user clicks the right mouse button in the client area, opening the context menu. Param The mouse event. MDN Reference |
oncontextrestored | public | null | (this , ev ) => any | MDN Reference |
oncopy | public | null | (this , ev ) => any | MDN Reference |
oncuechange | public | null | (this , ev ) => any | MDN Reference |
oncut | public | null | (this , ev ) => any | MDN Reference |
ondblclick | public | null | (this , ev ) => any | Fires when the user double-clicks the object. Param The mouse event. MDN Reference |
ondrag | public | null | (this , ev ) => any | Fires on the source object continuously during a drag operation. Param The event. MDN Reference |
ondragend | public | null | (this , ev ) => any | Fires on the source object when the user releases the mouse at the close of a drag operation. Param The event. MDN Reference |
ondragenter | public | null | (this , ev ) => any | Fires on the target element when the user drags the object to a valid drop target. Param The drag event. MDN Reference |
ondragleave | public | null | (this , ev ) => any | Fires on the target object when the user moves the mouse out of a valid drop target during a drag operation. Param The drag event. MDN Reference |
ondragover | public | null | (this , ev ) => any | Fires on the target element continuously while the user drags the object over a valid drop target. Param The event. MDN Reference |
ondragstart | public | null | (this , ev ) => any | Fires on the source object when the user starts to drag a text selection or selected object. Param The event. MDN Reference |
ondrop | public | null | (this , ev ) => any | MDN Reference |
ondurationchange | public | null | (this , ev ) => any | Occurs when the duration attribute is updated. Param The event. MDN Reference |
onemptied | public | null | (this , ev ) => any | Occurs when the media element is reset to its initial state. Param The event. MDN Reference |
onended | public | null | (this , ev ) => any | Occurs when the end of playback is reached. Param The event MDN Reference |
onerror | public | OnErrorEventHandler | Fires when an error occurs during object loading. Param The event. MDN Reference | HTMLElement.onerror |
onfocus | public | null | (this , ev ) => any | Fires when the object receives focus. Param The event. MDN Reference |
onformdata | public | null | (this , ev ) => any | MDN Reference |
ongotpointercapture | public | null | (this , ev ) => any | MDN Reference |
oninput | public | null | (this , ev ) => any | MDN Reference |
oninvalid | public | null | (this , ev ) => any | MDN Reference |
onkeydown | public | null | (this , ev ) => any | Fires when the user presses a key. Param The keyboard event MDN Reference |
onkeypress | public | null | (this , ev ) => any | Fires when the user presses an alphanumeric key. Param The event. Deprecated MDN Reference |
onkeyup | public | null | (this , ev ) => any | Fires when the user releases a key. Param The keyboard event MDN Reference |
onload | public | null | (this , ev ) => any | Fires immediately after the browser loads the object. Param The event. MDN Reference |
onloadeddata | public | null | (this , ev ) => any | Occurs when media data is loaded at the current playback position. Param The event. MDN Reference |
onloadedmetadata | public | null | (this , ev ) => any | Occurs when the duration and dimensions of the media have been determined. Param The event. MDN Reference |
onloadstart | public | null | (this , ev ) => any | Occurs when Internet Explorer begins looking for media data. Param The event. MDN Reference |
onlostpointercapture | public | null | (this , ev ) => any | MDN Reference |
onmousedown | public | null | (this , ev ) => any | Fires when the user clicks the object with either mouse button. Param The mouse event. MDN Reference |
onmouseenter | public | null | (this , ev ) => any | MDN Reference |
onmouseleave | public | null | (this , ev ) => any | MDN Reference |
onmousemove | public | null | (this , ev ) => any | Fires when the user moves the mouse over the object. Param The mouse event. MDN Reference |
onmouseout | public | null | (this , ev ) => any | Fires when the user moves the mouse pointer outside the boundaries of the object. Param The mouse event. MDN Reference |
onmouseover | public | null | (this , ev ) => any | Fires when the user moves the mouse pointer into the object. Param The mouse event. MDN Reference |
onmouseup | public | null | (this , ev ) => any | Fires when the user releases a mouse button while the mouse is over the object. Param The mouse event. MDN Reference |
onpaste | public | null | (this , ev ) => any | MDN Reference |
onpause | public | null | (this , ev ) => any | Occurs when playback is paused. Param The event. MDN Reference |
onplay | public | null | (this , ev ) => any | Occurs when the play method is requested. Param The event. MDN Reference |
onplaying | public | null | (this , ev ) => any | Occurs when the audio or video has started playing. Param The event. MDN Reference |
onpointercancel | public | null | (this , ev ) => any | MDN Reference |
onpointerdown | public | null | (this , ev ) => any | MDN Reference |
onpointerenter | public | null | (this , ev ) => any | MDN Reference |
onpointerleave | public | null | (this , ev ) => any | MDN Reference |
onpointermove | public | null | (this , ev ) => any | MDN Reference |
onpointerout | public | null | (this , ev ) => any | MDN Reference |
onpointerover | public | null | (this , ev ) => any | MDN Reference |
onpointerup | public | null | (this , ev ) => any | MDN Reference |
onprogress | public | null | (this , ev ) => any | Occurs to indicate progress while downloading media data. Param The event. MDN Reference |
onratechange | public | null | (this , ev ) => any | Occurs when the playback rate is increased or decreased. Param The event. MDN Reference |
onreset | public | null | (this , ev ) => any | Fires when the user resets a form. Param The event. MDN Reference |
onresize | public | null | (this , ev ) => any | MDN Reference |
onscroll | public | null | (this , ev ) => any | Fires when the user repositions the scroll box in the scroll bar on the object. Param The event. MDN Reference |
onscrollend | public | null | (this , ev ) => any | MDN Reference |
onsecuritypolicyviolation | public | null | (this , ev ) => any | MDN Reference |
onseeked | public | null | (this , ev ) => any | Occurs when the seek operation ends. Param The event. MDN Reference |
onseeking | public | null | (this , ev ) => any | Occurs when the current playback position is moved. Param The event. MDN Reference |
onselect | public | null | (this , ev ) => any | Fires when the current selection changes. Param The event. MDN Reference |
onselectionchange | public | null | (this , ev ) => any | MDN Reference |
onselectstart | public | null | (this , ev ) => any | MDN Reference |
onslotchange | public | null | (this , ev ) => any | MDN Reference |
onstalled | public | null | (this , ev ) => any | Occurs when the download has stopped. Param The event. MDN Reference |
onsubmit | public | null | (this , ev ) => any | MDN Reference |
onsuspend | public | null | (this , ev ) => any | Occurs if the load operation has been intentionally halted. Param The event. MDN Reference |
ontimeupdate | public | null | (this , ev ) => any | Occurs to indicate the current playback position. Param The event. MDN Reference |
ontoggle | public | null | (this , ev ) => any | MDN Reference |
ontouchcancel? | public | null | (this , ev ) => any | MDN Reference |
ontouchend? | public | null | (this , ev ) => any | MDN Reference |
ontouchmove? | public | null | (this , ev ) => any | MDN Reference |
ontouchstart? | public | null | (this , ev ) => any | MDN Reference |
ontransitioncancel | public | null | (this , ev ) => any | MDN Reference |
ontransitionend | public | null | (this , ev ) => any | MDN Reference |
ontransitionrun | public | null | (this , ev ) => any | MDN Reference |
ontransitionstart | public | null | (this , ev ) => any | MDN Reference |
onvolumechange | public | null | (this , ev ) => any | Occurs when the volume is changed, or playback is muted or unmuted. Param The event. MDN Reference |
onwaiting | public | null | (this , ev ) => any | Occurs when playback stops because the next frame of a video resource is not available. Param The event. MDN Reference |
onwebkitanimationend | public | null | (this , ev ) => any | Deprecated This is a legacy alias of onanimationend . MDN Reference |
onwebkitanimationiteration | public | null | (this , ev ) => any | Deprecated This is a legacy alias of onanimationiteration . MDN Reference |
onwebkitanimationstart | public | null | (this , ev ) => any | Deprecated This is a legacy alias of onanimationstart . MDN Reference |
onwebkittransitionend | public | null | (this , ev ) => any | Deprecated This is a legacy alias of ontransitionend . MDN Reference |
onwheel | public | null | (this , ev ) => any | MDN Reference |
accessKey | public | string | MDN Reference | HTMLElement.accessKey |
accessKeyLabel | readonly | string | MDN Reference | HTMLElement.accessKeyLabel |
autocapitalize | public | string | MDN Reference | HTMLElement.autocapitalize |
dir | public | string | MDN Reference | HTMLElement.dir |
draggable | public | boolean | MDN Reference | HTMLElement.draggable |
hidden | public | boolean | MDN Reference | HTMLElement.hidden |
inert | public | boolean | MDN Reference | HTMLElement.inert |
innerText | public | string | MDN Reference | HTMLElement.innerText |
lang | public | string | MDN Reference | HTMLElement.lang |
offsetHeight | readonly | number | MDN Reference | HTMLElement.offsetHeight |
offsetLeft | readonly | number | MDN Reference | HTMLElement.offsetLeft |
offsetParent | readonly | null | Element | MDN Reference |
offsetTop | readonly | number | MDN Reference | HTMLElement.offsetTop |
offsetWidth | readonly | number | MDN Reference | HTMLElement.offsetWidth |
outerText | public | string | MDN Reference | HTMLElement.outerText |
popover | public | null | string | MDN Reference |
spellcheck | public | boolean | MDN Reference | HTMLElement.spellcheck |
title | public | string | MDN Reference | HTMLElement.title |
translate | public | boolean | MDN Reference | HTMLElement.translate |
autofocus | public | boolean | MDN Reference | HTMLElement.autofocus |
dataset | readonly | DOMStringMap | MDN Reference | HTMLElement.dataset |
nonce? | public | string | MDN Reference | HTMLElement.nonce |
tabIndex | public | number | MDN Reference | HTMLElement.tabIndex |
baseURI | readonly | string | Returns node’s node document’s document base URL. MDN Reference | HTMLElement.baseURI |
childNodes | readonly | NodeListOf <ChildNode > | Returns the children. MDN Reference | HTMLElement.childNodes |
firstChild | readonly | null | ChildNode | Returns the first child. MDN Reference |
isConnected | readonly | boolean | Returns true if node is connected and false otherwise. MDN Reference | HTMLElement.isConnected |
lastChild | readonly | null | ChildNode | Returns the last child. MDN Reference |
nextSibling | readonly | null | ChildNode | Returns the next sibling. MDN Reference |
nodeName | readonly | string | Returns a string appropriate for the type of node. MDN Reference | HTMLElement.nodeName |
nodeType | readonly | number | Returns the type of node. MDN Reference | HTMLElement.nodeType |
nodeValue | public | null | string | MDN Reference |
parentElement | readonly | null | HTMLElement | Returns the parent element. MDN Reference |
parentNode | readonly | null | ParentNode | Returns the parent. MDN Reference |
previousSibling | readonly | null | ChildNode | Returns the previous sibling. MDN Reference |
textContent | public | null | string | MDN Reference |
ELEMENT_NODE | readonly | 1 | node is an element. | HTMLElement.ELEMENT_NODE |
ATTRIBUTE_NODE | readonly | 2 | - | HTMLElement.ATTRIBUTE_NODE |
TEXT_NODE | readonly | 3 | node is a Text node. | HTMLElement.TEXT_NODE |
CDATA_SECTION_NODE | readonly | 4 | node is a CDATASection node. | HTMLElement.CDATA_SECTION_NODE |
ENTITY_REFERENCE_NODE | readonly | 5 | - | HTMLElement.ENTITY_REFERENCE_NODE |
ENTITY_NODE | readonly | 6 | - | HTMLElement.ENTITY_NODE |
PROCESSING_INSTRUCTION_NODE | readonly | 7 | node is a ProcessingInstruction node. | HTMLElement.PROCESSING_INSTRUCTION_NODE |
COMMENT_NODE | readonly | 8 | node is a Comment node. | HTMLElement.COMMENT_NODE |
DOCUMENT_NODE | readonly | 9 | node is a document. | HTMLElement.DOCUMENT_NODE |
DOCUMENT_TYPE_NODE | readonly | 10 | node is a doctype. | HTMLElement.DOCUMENT_TYPE_NODE |
DOCUMENT_FRAGMENT_NODE | readonly | 11 | node is a DocumentFragment node. | HTMLElement.DOCUMENT_FRAGMENT_NODE |
NOTATION_NODE | readonly | 12 | - | HTMLElement.NOTATION_NODE |
DOCUMENT_POSITION_DISCONNECTED | readonly | 1 | Set when node and other are not in the same tree. | HTMLElement.DOCUMENT_POSITION_DISCONNECTED |
DOCUMENT_POSITION_PRECEDING | readonly | 2 | Set when other is preceding node. | HTMLElement.DOCUMENT_POSITION_PRECEDING |
DOCUMENT_POSITION_FOLLOWING | readonly | 4 | Set when other is following node. | HTMLElement.DOCUMENT_POSITION_FOLLOWING |
DOCUMENT_POSITION_CONTAINS | readonly | 8 | Set when other is an ancestor of node. | HTMLElement.DOCUMENT_POSITION_CONTAINS |
DOCUMENT_POSITION_CONTAINED_BY | readonly | 16 | Set when other is a descendant of node. | HTMLElement.DOCUMENT_POSITION_CONTAINED_BY |
DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC | readonly | 32 | - | HTMLElement.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC |
nextElementSibling | readonly | null | Element | Returns the first following sibling that is an element, and null otherwise. MDN Reference |
previousElementSibling | readonly | null | Element | Returns the first preceding sibling that is an element, and null otherwise. MDN Reference |
childElementCount | readonly | number | MDN Reference | HTMLElement.childElementCount |
children | readonly | HTMLCollection | Returns the child elements. MDN Reference | HTMLElement.children |
firstElementChild | readonly | null | Element | Returns the first child that is an element, and null otherwise. MDN Reference |
lastElementChild | readonly | null | Element | Returns the last child that is an element, and null otherwise. MDN Reference |
assignedSlot | readonly | null | HTMLSlotElement | MDN Reference |