Skip to main content

Interface: Element

Element is the most general base class from which all objects in a Document inherit. It only has methods and properties common to all kinds of elements. More specific classes inherit from Element.

MDN Reference

Extends

  • Node.ARIAMixin.Animatable.ChildNode.NonDocumentTypeChildNode.ParentNode.Slottable

Extended by

Properties

__evolv__

__evolv__: MutateContext


ariaAtomic

ariaAtomic: null | string

MDN Reference

Inherited from

ARIAMixin.ariaAtomic


ariaAutoComplete

ariaAutoComplete: null | string

MDN Reference

Inherited from

ARIAMixin.ariaAutoComplete


ariaBrailleLabel

ariaBrailleLabel: null | string

MDN Reference

Inherited from

ARIAMixin.ariaBrailleLabel


ariaBrailleRoleDescription

ariaBrailleRoleDescription: null | string

MDN Reference

Inherited from

ARIAMixin.ariaBrailleRoleDescription


ariaBusy

ariaBusy: null | string

MDN Reference

Inherited from

ARIAMixin.ariaBusy


ariaChecked

ariaChecked: null | string

MDN Reference

Inherited from

ARIAMixin.ariaChecked


ariaColCount

ariaColCount: null | string

MDN Reference

Inherited from

ARIAMixin.ariaColCount


ariaColIndex

ariaColIndex: null | string

MDN Reference

Inherited from

ARIAMixin.ariaColIndex


ariaColSpan

ariaColSpan: null | string

MDN Reference

Inherited from

ARIAMixin.ariaColSpan


ariaCurrent

ariaCurrent: null | string

MDN Reference

Inherited from

ARIAMixin.ariaCurrent


ariaDescription

ariaDescription: null | string

MDN Reference

Inherited from

ARIAMixin.ariaDescription


ariaDisabled

ariaDisabled: null | string

MDN Reference

Inherited from

ARIAMixin.ariaDisabled


ariaExpanded

ariaExpanded: null | string

MDN Reference

Inherited from

ARIAMixin.ariaExpanded


ariaHasPopup

ariaHasPopup: null | string

MDN Reference

Inherited from

ARIAMixin.ariaHasPopup


ariaHidden

ariaHidden: null | string

MDN Reference

Inherited from

ARIAMixin.ariaHidden


ariaInvalid

ariaInvalid: null | string

Inherited from

ARIAMixin.ariaInvalid


ariaKeyShortcuts

ariaKeyShortcuts: null | string

MDN Reference

Inherited from

ARIAMixin.ariaKeyShortcuts


ariaLabel

ariaLabel: null | string

MDN Reference

Inherited from

ARIAMixin.ariaLabel


ariaLevel

ariaLevel: null | string

MDN Reference

Inherited from

ARIAMixin.ariaLevel


ariaLive

ariaLive: null | string

MDN Reference

Inherited from

ARIAMixin.ariaLive


ariaModal

ariaModal: null | string

MDN Reference

Inherited from

ARIAMixin.ariaModal


ariaMultiLine

ariaMultiLine: null | string

MDN Reference

Inherited from

ARIAMixin.ariaMultiLine


ariaMultiSelectable

ariaMultiSelectable: null | string

MDN Reference

Inherited from

ARIAMixin.ariaMultiSelectable


ariaOrientation

ariaOrientation: null | string

MDN Reference

Inherited from

ARIAMixin.ariaOrientation


ariaPlaceholder

ariaPlaceholder: null | string

MDN Reference

Inherited from

ARIAMixin.ariaPlaceholder


ariaPosInSet

ariaPosInSet: null | string

MDN Reference

Inherited from

ARIAMixin.ariaPosInSet


ariaPressed

ariaPressed: null | string

MDN Reference

Inherited from

ARIAMixin.ariaPressed


ariaReadOnly

ariaReadOnly: null | string

MDN Reference

Inherited from

ARIAMixin.ariaReadOnly


ariaRequired

ariaRequired: null | string

MDN Reference

Inherited from

ARIAMixin.ariaRequired


ariaRoleDescription

ariaRoleDescription: null | string

MDN Reference

Inherited from

ARIAMixin.ariaRoleDescription


ariaRowCount

ariaRowCount: null | string

MDN Reference

Inherited from

ARIAMixin.ariaRowCount


ariaRowIndex

ariaRowIndex: null | string

MDN Reference

Inherited from

ARIAMixin.ariaRowIndex


ariaRowSpan

ariaRowSpan: null | string

MDN Reference

Inherited from

ARIAMixin.ariaRowSpan


ariaSelected

ariaSelected: null | string

MDN Reference

Inherited from

ARIAMixin.ariaSelected


ariaSetSize

ariaSetSize: null | string

MDN Reference

Inherited from

ARIAMixin.ariaSetSize


ariaSort

ariaSort: null | string

MDN Reference

Inherited from

ARIAMixin.ariaSort


ariaValueMax

ariaValueMax: null | string

MDN Reference

Inherited from

ARIAMixin.ariaValueMax


ariaValueMin

ariaValueMin: null | string

MDN Reference

Inherited from

ARIAMixin.ariaValueMin


ariaValueNow

ariaValueNow: null | string

MDN Reference

Inherited from

ARIAMixin.ariaValueNow


ariaValueText

ariaValueText: null | string

MDN Reference

Inherited from

ARIAMixin.ariaValueText


assignedSlot

readonly assignedSlot: null | HTMLSlotElement

MDN Reference

Inherited from

Slottable.assignedSlot


ATTRIBUTE_NODE

readonly ATTRIBUTE_NODE: 2

Inherited from

Node.ATTRIBUTE_NODE


attributes

readonly attributes: NamedNodeMap

MDN Reference


baseURI

readonly baseURI: string

Returns node's node document's document base URL.

MDN Reference

Inherited from

Node.baseURI


CDATA_SECTION_NODE

readonly CDATA_SECTION_NODE: 4

node is a CDATASection node.

Inherited from

Node.CDATA_SECTION_NODE


childElementCount

readonly childElementCount: number

MDN Reference

Inherited from

ParentNode.childElementCount


childNodes

readonly childNodes: NodeListOf<ChildNode>

Returns the children.

MDN Reference

Inherited from

Node.childNodes


children

readonly children: HTMLCollection

Returns the child elements.

MDN Reference

Inherited from

ParentNode.children


classList

readonly classList: DOMTokenList

Allows for manipulation of element's class content attribute as a set of whitespace-separated tokens through a DOMTokenList object.

MDN Reference


className

className: string

Returns the value of element's class content attribute. Can be set to change it.

MDN Reference


clientHeight

readonly clientHeight: number

MDN Reference


clientLeft

readonly clientLeft: number

MDN Reference


clientTop

readonly clientTop: number

MDN Reference


clientWidth

readonly clientWidth: number

MDN Reference


COMMENT_NODE

readonly COMMENT_NODE: 8

node is a Comment node.

Inherited from

Node.COMMENT_NODE


DOCUMENT_FRAGMENT_NODE

readonly DOCUMENT_FRAGMENT_NODE: 11

node is a DocumentFragment node.

Inherited from

Node.DOCUMENT_FRAGMENT_NODE


DOCUMENT_NODE

readonly DOCUMENT_NODE: 9

node is a document.

Inherited from

Node.DOCUMENT_NODE


DOCUMENT_POSITION_CONTAINED_BY

readonly DOCUMENT_POSITION_CONTAINED_BY: 16

Set when other is a descendant of node.

Inherited from

Node.DOCUMENT_POSITION_CONTAINED_BY


DOCUMENT_POSITION_CONTAINS

readonly DOCUMENT_POSITION_CONTAINS: 8

Set when other is an ancestor of node.

Inherited from

Node.DOCUMENT_POSITION_CONTAINS


DOCUMENT_POSITION_DISCONNECTED

readonly DOCUMENT_POSITION_DISCONNECTED: 1

Set when node and other are not in the same tree.

Inherited from

Node.DOCUMENT_POSITION_DISCONNECTED


DOCUMENT_POSITION_FOLLOWING

readonly DOCUMENT_POSITION_FOLLOWING: 4

Set when other is following node.

Inherited from

Node.DOCUMENT_POSITION_FOLLOWING


DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC

readonly DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: 32

Inherited from

Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC


DOCUMENT_POSITION_PRECEDING

readonly DOCUMENT_POSITION_PRECEDING: 2

Set when other is preceding node.

Inherited from

Node.DOCUMENT_POSITION_PRECEDING


DOCUMENT_TYPE_NODE

readonly DOCUMENT_TYPE_NODE: 10

node is a doctype.

Inherited from

Node.DOCUMENT_TYPE_NODE


ELEMENT_NODE

readonly ELEMENT_NODE: 1

node is an element.

Inherited from

Node.ELEMENT_NODE


ENTITY_NODE

readonly ENTITY_NODE: 6

Inherited from

Node.ENTITY_NODE


ENTITY_REFERENCE_NODE

readonly ENTITY_REFERENCE_NODE: 5

Inherited from

Node.ENTITY_REFERENCE_NODE


firstChild

readonly firstChild: null | ChildNode

Returns the first child.

MDN Reference

Inherited from

Node.firstChild


firstElementChild

readonly firstElementChild: null | Element

Returns the first child that is an element, and null otherwise.

MDN Reference

Inherited from

ParentNode.firstElementChild


id

id: string

Returns the value of element's id content attribute. Can be set to change it.

MDN Reference


innerHTML

innerHTML: string

MDN Reference


isConnected

readonly isConnected: boolean

Returns true if node is connected and false otherwise.

MDN Reference

Inherited from

Node.isConnected


lastChild

readonly lastChild: null | ChildNode

Returns the last child.

MDN Reference

Inherited from

Node.lastChild


lastElementChild

readonly lastElementChild: null | Element

Returns the last child that is an element, and null otherwise.

MDN Reference

Inherited from

ParentNode.lastElementChild


localName

readonly localName: string

Returns the local name.

MDN Reference


namespaceURI

readonly namespaceURI: null | string

Returns the namespace.

MDN Reference


nextElementSibling

readonly nextElementSibling: null | Element

Returns the first following sibling that is an element, and null otherwise.

MDN Reference

Inherited from

NonDocumentTypeChildNode.nextElementSibling


nextSibling

readonly nextSibling: null | ChildNode

Returns the next sibling.

MDN Reference

Inherited from

Node.nextSibling


nodeName

readonly nodeName: string

Returns a string appropriate for the type of node.

MDN Reference

Inherited from

Node.nodeName


nodeType

readonly nodeType: number

Returns the type of node.

MDN Reference

Inherited from

Node.nodeType


nodeValue

nodeValue: null | string

MDN Reference

Inherited from

Node.nodeValue


NOTATION_NODE

readonly NOTATION_NODE: 12

Inherited from

Node.NOTATION_NODE


onfullscreenchange

onfullscreenchange: null | (this, ev) => any

MDN Reference


onfullscreenerror

onfullscreenerror: null | (this, ev) => any

MDN Reference


outerHTML

outerHTML: string

MDN Reference


ownerDocument

readonly ownerDocument: Document

Returns the node document. Returns null for documents.

MDN Reference

Overrides

Node.ownerDocument


parentElement

readonly parentElement: null | HTMLElement

Returns the parent element.

MDN Reference

Inherited from

Node.parentElement


parentNode

readonly parentNode: null | ParentNode

Returns the parent.

MDN Reference

Inherited from

Node.parentNode


part

readonly part: DOMTokenList

MDN Reference


prefix

readonly prefix: null | string

Returns the namespace prefix.

MDN Reference


previousElementSibling

readonly previousElementSibling: null | Element

Returns the first preceding sibling that is an element, and null otherwise.

MDN Reference

Inherited from

NonDocumentTypeChildNode.previousElementSibling


previousSibling

readonly previousSibling: null | ChildNode

Returns the previous sibling.

MDN Reference

Inherited from

Node.previousSibling


PROCESSING_INSTRUCTION_NODE

readonly PROCESSING_INSTRUCTION_NODE: 7

node is a ProcessingInstruction node.

Inherited from

Node.PROCESSING_INSTRUCTION_NODE


role

role: null | string

Inherited from

ARIAMixin.role


scrollHeight

readonly scrollHeight: number

MDN Reference


scrollLeft

scrollLeft: number

MDN Reference


scrollTop

scrollTop: number

MDN Reference


scrollWidth

readonly scrollWidth: number

MDN Reference


shadowRoot

readonly shadowRoot: null | ShadowRoot

Returns element's shadow root, if any, and if shadow root's mode is "open", and null otherwise.

MDN Reference


slot

slot: string

Returns the value of element's slot content attribute. Can be set to change it.

MDN Reference


tagName

readonly tagName: string

Returns the HTML-uppercased qualified name.

MDN Reference


TEXT_NODE

readonly TEXT_NODE: 3

node is a Text node.

Inherited from

Node.TEXT_NODE


textContent

textContent: null | string

MDN Reference

Inherited from

Node.textContent

Methods

addEventListener()

Call Signature

addEventListener<K>(type, listener, options?): void

Appends an event listener for events whose type attribute value is type. The callback argument sets the callback that will be invoked when the event is dispatched.

The options argument sets listener-specific options. For compatibility this can be a boolean, in which case the method behaves exactly as if the value was specified as options's capture.

When set to true, options's capture prevents callback from being invoked when the event's eventPhase attribute value is BUBBLING_PHASE. When false (or not present), callback will not be invoked when event's eventPhase attribute value is CAPTURING_PHASE. Either way, callback will be invoked if event's eventPhase attribute value is AT_TARGET.

When set to true, options's passive indicates that the callback will not cancel the event by invoking preventDefault(). This is used to enable performance optimizations described in § 2.8 Observing event listeners.

When set to true, options's once indicates that the callback will only be invoked once after which the event listener will be removed.

If an AbortSignal is passed for options's signal, then the event listener will be removed when signal is aborted.

The event listener is appended to target's event listener list and is not appended if it has the same type, callback, and capture.

MDN Reference

Type Parameters
Type Parameter
K extends keyof ElementEventMap
Parameters
ParameterType
typeK
listener(this, ev) => any
options?boolean | AddEventListenerOptions
Returns

void

Overrides

Node.addEventListener

Call Signature

addEventListener(type, listener, options?): void

Appends an event listener for events whose type attribute value is type. The callback argument sets the callback that will be invoked when the event is dispatched.

The options argument sets listener-specific options. For compatibility this can be a boolean, in which case the method behaves exactly as if the value was specified as options's capture.

When set to true, options's capture prevents callback from being invoked when the event's eventPhase attribute value is BUBBLING_PHASE. When false (or not present), callback will not be invoked when event's eventPhase attribute value is CAPTURING_PHASE. Either way, callback will be invoked if event's eventPhase attribute value is AT_TARGET.

When set to true, options's passive indicates that the callback will not cancel the event by invoking preventDefault(). This is used to enable performance optimizations described in § 2.8 Observing event listeners.

When set to true, options's once indicates that the callback will only be invoked once after which the event listener will be removed.

If an AbortSignal is passed for options's signal, then the event listener will be removed when signal is aborted.

The event listener is appended to target's event listener list and is not appended if it has the same type, callback, and capture.

MDN Reference

Parameters
ParameterType
typestring
listenerEventListenerOrEventListenerObject
options?boolean | AddEventListenerOptions
Returns

void

Overrides

Node.addEventListener


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 Reference

Parameters

ParameterType
...nodes(string | Node)[]

Returns

void

Inherited from

ChildNode.after


animate()

animate(keyframes, options?): Animation

MDN Reference

Parameters

ParameterType
keyframesnull | Keyframe[] | PropertyIndexedKeyframes
options?number | KeyframeAnimationOptions

Returns

Animation

Inherited from

Animatable.animate


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 Reference

Parameters

ParameterType
...nodes(string | Node)[]

Returns

void

Inherited from

ParentNode.append


appendChild()

appendChild<T>(node): T

MDN Reference

Type Parameters

Type Parameter
T extends Node

Parameters

ParameterType
nodeT

Returns

T

Inherited from

Node.appendChild


attachShadow()

attachShadow(init): ShadowRoot

Creates a shadow root for element and returns it.

MDN Reference

Parameters

ParameterType
initShadowRootInit

Returns

ShadowRoot


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 Reference

Parameters

ParameterType
...nodes(string | Node)[]

Returns

void

Inherited from

ChildNode.before


checkVisibility()

checkVisibility(options?): boolean

MDN Reference

Parameters

ParameterType
options?CheckVisibilityOptions

Returns

boolean


cloneNode()

cloneNode(deep?): Node

Returns a copy of node. If deep is true, the copy also includes the node's descendants.

MDN Reference

Parameters

ParameterType
deep?boolean

Returns

Node

Inherited from

Node.cloneNode


closest()

Call Signature

closest<K>(selector): null | HTMLElementTagNameMap[K]

Returns the first (starting at element) inclusive ancestor that matches selectors, and null otherwise.

MDN Reference

Type Parameters
Type Parameter
K extends keyof HTMLElementTagNameMap
Parameters
ParameterType
selectorK
Returns

null | HTMLElementTagNameMap[K]

Call Signature

closest<K>(selector): null | SVGElementTagNameMap[K]

Type Parameters
Type Parameter
K extends keyof SVGElementTagNameMap
Parameters
ParameterType
selectorK
Returns

null | SVGElementTagNameMap[K]

Call Signature

closest<K>(selector): null | MathMLElementTagNameMap[K]

Type Parameters
Type Parameter
K extends keyof MathMLElementTagNameMap
Parameters
ParameterType
selectorK
Returns

null | MathMLElementTagNameMap[K]

Call Signature

closest<E>(selectors): null | E

Type Parameters
Type ParameterDefault type
E extends ElementElement
Parameters
ParameterType
selectorsstring
Returns

null | E


compareDocumentPosition()

compareDocumentPosition(other): number

Returns a bitmask indicating the position of other relative to node.

MDN Reference

Parameters

ParameterType
otherNode

Returns

number

Inherited from

Node.compareDocumentPosition


computedStyleMap()

computedStyleMap(): StylePropertyMapReadOnly

MDN Reference

Returns

StylePropertyMapReadOnly


contains()

contains(other): boolean

Returns true if other is an inclusive descendant of node, and false otherwise.

MDN Reference

Parameters

ParameterType
othernull | Node

Returns

boolean

Inherited from

Node.contains


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 Reference

Parameters

ParameterType
eventEvent

Returns

boolean

Inherited from

Node.dispatchEvent


getAnimations()

getAnimations(options?): Animation[]

MDN Reference

Parameters

ParameterType
options?GetAnimationsOptions

Returns

Animation[]

Inherited from

Animatable.getAnimations


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 Reference

Parameters

ParameterType
qualifiedNamestring

Returns

null | string


getAttributeNames()

getAttributeNames(): string[]

Returns the qualified names of all element's attributes. Can contain duplicates.

MDN Reference

Returns

string[]


getAttributeNode()

getAttributeNode(qualifiedName): null | Attr

MDN Reference

Parameters

ParameterType
qualifiedNamestring

Returns

null | Attr


getAttributeNodeNS()

getAttributeNodeNS(namespace, localName): null | Attr

MDN Reference

Parameters

ParameterType
namespacenull | string
localNamestring

Returns

null | Attr


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 Reference

Parameters

ParameterType
namespacenull | string
localNamestring

Returns

null | string


getBoundingClientRect()

getBoundingClientRect(): DOMRect

MDN Reference

Returns

DOMRect


getClientRects()

getClientRects(): DOMRectList

MDN Reference

Returns

DOMRectList


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 Reference

Parameters

ParameterType
classNamesstring

Returns

HTMLCollectionOf<Element>


getElementsByTagName()

Call Signature

getElementsByTagName<K>(qualifiedName): HTMLCollectionOf<HTMLElementTagNameMap[K]>

MDN Reference

Type Parameters
Type Parameter
K extends keyof HTMLElementTagNameMap
Parameters
ParameterType
qualifiedNameK
Returns

HTMLCollectionOf<HTMLElementTagNameMap[K]>

Call Signature

getElementsByTagName<K>(qualifiedName): HTMLCollectionOf<SVGElementTagNameMap[K]>

Type Parameters
Type Parameter
K extends keyof SVGElementTagNameMap
Parameters
ParameterType
qualifiedNameK
Returns

HTMLCollectionOf<SVGElementTagNameMap[K]>

Call Signature

getElementsByTagName<K>(qualifiedName): HTMLCollectionOf<MathMLElementTagNameMap[K]>

Type Parameters
Type Parameter
K extends keyof MathMLElementTagNameMap
Parameters
ParameterType
qualifiedNameK
Returns

HTMLCollectionOf<MathMLElementTagNameMap[K]>

Call Signature

getElementsByTagName<K>(qualifiedName): HTMLCollectionOf<HTMLElementDeprecatedTagNameMap[K]>

Type Parameters
Type Parameter
K extends keyof HTMLElementDeprecatedTagNameMap
Parameters
ParameterType
qualifiedNameK
Returns

HTMLCollectionOf<HTMLElementDeprecatedTagNameMap[K]>

Deprecated

Call Signature

getElementsByTagName(qualifiedName): HTMLCollectionOf<Element>

Parameters
ParameterType
qualifiedNamestring
Returns

HTMLCollectionOf<Element>


getElementsByTagNameNS()

Call Signature

getElementsByTagNameNS(namespaceURI, localName): HTMLCollectionOf<HTMLElement>

MDN Reference

Parameters
ParameterType
namespaceURI"http://www.w3.org/1999/xhtml"
localNamestring
Returns

HTMLCollectionOf<HTMLElement>

Call Signature

getElementsByTagNameNS(namespaceURI, localName): HTMLCollectionOf<SVGElement>

Parameters
ParameterType
namespaceURI"http://www.w3.org/2000/svg"
localNamestring
Returns

HTMLCollectionOf<SVGElement>

Call Signature

getElementsByTagNameNS(namespaceURI, localName): HTMLCollectionOf<MathMLElement>

Parameters
ParameterType
namespaceURI"http://www.w3.org/1998/Math/MathML"
localNamestring
Returns

HTMLCollectionOf<MathMLElement>

Call Signature

getElementsByTagNameNS(namespace, localName): HTMLCollectionOf<Element>

Parameters
ParameterType
namespacenull | string
localNamestring
Returns

HTMLCollectionOf<Element>


getHTML()

getHTML(options?): string

MDN Reference

Parameters

ParameterType
options?GetHTMLOptions

Returns

string


getRootNode()

getRootNode(options?): Node

Returns node's root.

MDN Reference

Parameters

ParameterType
options?GetRootNodeOptions

Returns

Node

Inherited from

Node.getRootNode


hasAttribute()

hasAttribute(qualifiedName): boolean

Returns true if element has an attribute whose qualified name is qualifiedName, and false otherwise.

MDN Reference

Parameters

ParameterType
qualifiedNamestring

Returns

boolean


hasAttributeNS()

hasAttributeNS(namespace, localName): boolean

Returns true if element has an attribute whose namespace is namespace and local name is localName.

MDN Reference

Parameters

ParameterType
namespacenull | string
localNamestring

Returns

boolean


hasAttributes()

hasAttributes(): boolean

Returns true if element has attributes, and false otherwise.

MDN Reference

Returns

boolean


hasChildNodes()

hasChildNodes(): boolean

Returns whether node has children.

MDN Reference

Returns

boolean

Inherited from

Node.hasChildNodes


hasPointerCapture()

hasPointerCapture(pointerId): boolean

MDN Reference

Parameters

ParameterType
pointerIdnumber

Returns

boolean


insertAdjacentElement()

insertAdjacentElement(where, element): null | Element

MDN Reference

Parameters

ParameterType
whereInsertPosition
elementElement

Returns

null | Element


insertAdjacentHTML()

insertAdjacentHTML(position, string): void

MDN Reference

Parameters

ParameterType
positionInsertPosition
stringstring

Returns

void


insertAdjacentText()

insertAdjacentText(where, data): void

MDN Reference

Parameters

ParameterType
whereInsertPosition
datastring

Returns

void


insertBefore()

insertBefore<T>(node, child): T

MDN Reference

Type Parameters

Type Parameter
T extends Node

Parameters

ParameterType
nodeT
childnull | Node

Returns

T

Inherited from

Node.insertBefore


isDefaultNamespace()

isDefaultNamespace(namespace): boolean

MDN Reference

Parameters

ParameterType
namespacenull | string

Returns

boolean

Inherited from

Node.isDefaultNamespace


isEqualNode()

isEqualNode(otherNode): boolean

Returns whether node and otherNode have the same properties.

MDN Reference

Parameters

ParameterType
otherNodenull | Node

Returns

boolean

Inherited from

Node.isEqualNode


isSameNode()

isSameNode(otherNode): boolean

MDN Reference

Parameters

ParameterType
otherNodenull | Node

Returns

boolean

Inherited from

Node.isSameNode


lookupNamespaceURI()

lookupNamespaceURI(prefix): null | string

MDN Reference

Parameters

ParameterType
prefixnull | string

Returns

null | string

Inherited from

Node.lookupNamespaceURI


lookupPrefix()

lookupPrefix(namespace): null | string

MDN Reference

Parameters

ParameterType
namespacenull | string

Returns

null | string

Inherited from

Node.lookupPrefix


matches()

matches(selectors): boolean

Returns true if matching selectors against element's root yields element, and false otherwise.

MDN Reference

Parameters

ParameterType
selectorsstring

Returns

boolean


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 Reference

Returns

void

Inherited from

Node.normalize


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 Reference

Parameters

ParameterType
...nodes(string | Node)[]

Returns

void

Inherited from

ParentNode.prepend


querySelector()

Call Signature

querySelector<K>(selectors): null | HTMLElementTagNameMap[K]

Returns the first element that is a descendant of node that matches selectors.

MDN Reference

Type Parameters
Type Parameter
K extends keyof HTMLElementTagNameMap
Parameters
ParameterType
selectorsK
Returns

null | HTMLElementTagNameMap[K]

Inherited from

ParentNode.querySelector

Call Signature

querySelector<K>(selectors): null | SVGElementTagNameMap[K]

Type Parameters
Type Parameter
K extends keyof SVGElementTagNameMap
Parameters
ParameterType
selectorsK
Returns

null | SVGElementTagNameMap[K]

Inherited from

ParentNode.querySelector

Call Signature

querySelector<K>(selectors): null | MathMLElementTagNameMap[K]

Type Parameters
Type Parameter
K extends keyof MathMLElementTagNameMap
Parameters
ParameterType
selectorsK
Returns

null | MathMLElementTagNameMap[K]

Inherited from

ParentNode.querySelector

Call Signature

querySelector<K>(selectors): null | HTMLElementDeprecatedTagNameMap[K]

Type Parameters
Type Parameter
K extends keyof HTMLElementDeprecatedTagNameMap
Parameters
ParameterType
selectorsK
Returns

null | HTMLElementDeprecatedTagNameMap[K]

Deprecated
Inherited from

ParentNode.querySelector

Call Signature

querySelector<E>(selectors): null | E

Type Parameters
Type ParameterDefault type
E extends ElementElement
Parameters
ParameterType
selectorsstring
Returns

null | E

Inherited from

ParentNode.querySelector


querySelectorAll()

Call Signature

querySelectorAll<K>(selectors): NodeListOf<HTMLElementTagNameMap[K]>

Returns all element descendants of node that match selectors.

MDN Reference

Type Parameters
Type Parameter
K extends keyof HTMLElementTagNameMap
Parameters
ParameterType
selectorsK
Returns

NodeListOf<HTMLElementTagNameMap[K]>

Inherited from

ParentNode.querySelectorAll

Call Signature

querySelectorAll<K>(selectors): NodeListOf<SVGElementTagNameMap[K]>

Type Parameters
Type Parameter
K extends keyof SVGElementTagNameMap
Parameters
ParameterType
selectorsK
Returns

NodeListOf<SVGElementTagNameMap[K]>

Inherited from

ParentNode.querySelectorAll

Call Signature

querySelectorAll<K>(selectors): NodeListOf<MathMLElementTagNameMap[K]>

Type Parameters
Type Parameter
K extends keyof MathMLElementTagNameMap
Parameters
ParameterType
selectorsK
Returns

NodeListOf<MathMLElementTagNameMap[K]>

Inherited from

ParentNode.querySelectorAll

Call Signature

querySelectorAll<K>(selectors): NodeListOf<HTMLElementDeprecatedTagNameMap[K]>

Type Parameters
Type Parameter
K extends keyof HTMLElementDeprecatedTagNameMap
Parameters
ParameterType
selectorsK
Returns

NodeListOf<HTMLElementDeprecatedTagNameMap[K]>

Deprecated
Inherited from

ParentNode.querySelectorAll

Call Signature

querySelectorAll<E>(selectors): NodeListOf<E>

Type Parameters
Type ParameterDefault type
E extends ElementElement
Parameters
ParameterType
selectorsstring
Returns

NodeListOf<E>

Inherited from

ParentNode.querySelectorAll


releasePointerCapture()

releasePointerCapture(pointerId): void

MDN Reference

Parameters

ParameterType
pointerIdnumber

Returns

void


remove()

remove(): void

Removes node.

MDN Reference

Returns

void

Inherited from

ChildNode.remove


removeAttribute()

removeAttribute(qualifiedName): void

Removes element's first attribute whose qualified name is qualifiedName.

MDN Reference

Parameters

ParameterType
qualifiedNamestring

Returns

void


removeAttributeNode()

removeAttributeNode(attr): Attr

MDN Reference

Parameters

ParameterType
attrAttr

Returns

Attr


removeAttributeNS()

removeAttributeNS(namespace, localName): void

Removes element's attribute whose namespace is namespace and local name is localName.

MDN Reference

Parameters

ParameterType
namespacenull | string
localNamestring

Returns

void


removeChild()

removeChild<T>(child): T

MDN Reference

Type Parameters

Type Parameter
T extends Node

Parameters

ParameterType
childT

Returns

T

Inherited from

Node.removeChild


removeEventListener()

Call Signature

removeEventListener<K>(type, listener, options?): void

Removes the event listener in target's event listener list with the same type, callback, and options.

MDN Reference

Type Parameters
Type Parameter
K extends keyof ElementEventMap
Parameters
ParameterType
typeK
listener(this, ev) => any
options?boolean | EventListenerOptions
Returns

void

Overrides

Node.removeEventListener

Call Signature

removeEventListener(type, listener, options?): void

Removes the event listener in target's event listener list with the same type, callback, and options.

MDN Reference

Parameters
ParameterType
typestring
listenerEventListenerOrEventListenerObject
options?boolean | EventListenerOptions
Returns

void

Overrides

Node.removeEventListener


replaceChild()

replaceChild<T>(node, child): T

MDN Reference

Type Parameters

Type Parameter
T extends Node

Parameters

ParameterType
nodeNode
childT

Returns

T

Inherited from

Node.replaceChild


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 Reference

Parameters

ParameterType
...nodes(string | Node)[]

Returns

void

Inherited from

ParentNode.replaceChildren


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 Reference

Parameters

ParameterType
...nodes(string | Node)[]

Returns

void

Inherited from

ChildNode.replaceWith


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 Reference

Parameters

ParameterType
options?FullscreenOptions

Returns

Promise<void>


requestPointerLock()

requestPointerLock(options?): Promise<void>

MDN Reference

Parameters

ParameterType
options?PointerLockOptions

Returns

Promise<void>


scroll()

Call Signature

scroll(options?): void

MDN Reference

Parameters
ParameterType
options?ScrollToOptions
Returns

void

Call Signature

scroll(x, y): void

Parameters
ParameterType
xnumber
ynumber
Returns

void


scrollBy()

Call Signature

scrollBy(options?): void

MDN Reference

Parameters
ParameterType
options?ScrollToOptions
Returns

void

Call Signature

scrollBy(x, y): void

Parameters
ParameterType
xnumber
ynumber
Returns

void


scrollIntoView()

scrollIntoView(arg?): void

MDN Reference

Parameters

ParameterType
arg?boolean | ScrollIntoViewOptions

Returns

void


scrollTo()

Call Signature

scrollTo(options?): void

MDN Reference

Parameters
ParameterType
options?ScrollToOptions
Returns

void

Call Signature

scrollTo(x, y): void

Parameters
ParameterType
xnumber
ynumber
Returns

void


setAttribute()

setAttribute(qualifiedName, value): void

Sets the value of element's first attribute whose qualified name is qualifiedName to value.

MDN Reference

Parameters

ParameterType
qualifiedNamestring
valuestring

Returns

void


setAttributeNode()

setAttributeNode(attr): null | Attr

MDN Reference

Parameters

ParameterType
attrAttr

Returns

null | Attr


setAttributeNodeNS()

setAttributeNodeNS(attr): null | Attr

MDN Reference

Parameters

ParameterType
attrAttr

Returns

null | Attr


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 Reference

Parameters

ParameterType
namespacenull | string
qualifiedNamestring
valuestring

Returns

void


setHTMLUnsafe()

setHTMLUnsafe(html): void

MDN Reference

Parameters

ParameterType
htmlstring

Returns

void


setPointerCapture()

setPointerCapture(pointerId): void

MDN Reference

Parameters

ParameterType
pointerIdnumber

Returns

void


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 Reference

Parameters

ParameterType
qualifiedNamestring
force?boolean

Returns

boolean


webkitMatchesSelector()

webkitMatchesSelector(selectors): boolean

Parameters

ParameterType
selectorsstring

Returns

boolean

Deprecated

This is a legacy alias of matches.

MDN Reference