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
MDN Reference
Hierarchy
Index
Properties
Methods
Properties
Readonly
ATTRIBUTE_Readonly
CDATA_node is a CDATASection node.
Readonly
COMMENT_node is a Comment node.
Readonly
DOCUMENT_node is a DocumentFragment node.
Readonly
DOCUMENT_node is a document.
Readonly
DOCUMENT_Set when other is a descendant of node.
Readonly
DOCUMENT_Set when other is an ancestor of node.
Readonly
DOCUMENT_Set when node and other are not in the same tree.
Readonly
DOCUMENT_Set when other is following node.
Readonly
DOCUMENT_Readonly
DOCUMENT_Set when other is preceding node.
Readonly
DOCUMENT_node is a doctype.
Readonly
ELEMENT_node is an element.
Readonly
ENTITY_Readonly
ENTITY_Readonly
NOTATION_Readonly
PROCESSING_node is a ProcessingInstruction node.
Readonly
TEXT_node is a Text node.
access Key
MDN Reference
Readonly
accessMDN Reference
align
Sets or retrieves how the object is aligned with adjacent text.
Deprecated
MDN Reference
aria Atomic
MDN Reference
aria Auto Complete
MDN Reference
aria Busy
MDN Reference
aria Checked
MDN Reference
aria Col Count
MDN Reference
aria Col Index
MDN Reference
aria Col Span
MDN Reference
aria Current
MDN Reference
aria Disabled
MDN Reference
aria Expanded
MDN Reference
aria Has Popup
MDN Reference
aria Hidden
MDN Reference
aria Invalid
aria Key Shortcuts
MDN Reference
aria Label
MDN Reference
aria Level
MDN Reference
aria Live
MDN Reference
aria Modal
MDN Reference
aria Multi Line
MDN Reference
aria Multi Selectable
MDN Reference
aria Orientation
MDN Reference
aria Placeholder
MDN Reference
aria Pos In Set
MDN Reference
aria Pressed
MDN Reference
aria Read Only
MDN Reference
aria Required
MDN Reference
aria Role Description
MDN Reference
aria Row Count
MDN Reference
aria Row Index
MDN Reference
aria Row Span
MDN Reference
aria Selected
MDN Reference
aria Set Size
MDN Reference
aria Sort
MDN Reference
aria Value Max
MDN Reference
aria Value Min
MDN Reference
aria Value Now
MDN Reference
aria Value Text
MDN Reference
Readonly
assignedMDN Reference
Readonly
attributeReadonly
attributesMDN Reference
autocapitalize
autofocus
Readonly
baseURIReturns node's node document's document base URL.
MDN Reference
Readonly
childMDN Reference
Readonly
childReturns the children.
MDN Reference
Readonly
childrenReturns the child elements.
MDN Reference
Readonly
classAllows for manipulation of element's class content attribute as a set of whitespace-separated tokens through a DOMTokenList object.
MDN Reference
class Name
Returns the value of element's class content attribute. Can be set to change it.
MDN Reference
Readonly
clientMDN Reference
Readonly
clientMDN Reference
Readonly
clientMDN Reference
Readonly
clientMDN Reference
content Editable
MDN Reference
Readonly
datasetMDN Reference
dir
MDN Reference
draggable
MDN Reference
enter Key Hint
MDN Reference
Readonly
firstReturns the first child.
MDN Reference
Readonly
firstReturns the first child that is an element, and null otherwise.
MDN Reference
hidden
MDN Reference
id
Returns the value of element's id content attribute. Can be set to change it.
MDN Reference
inert
MDN Reference
innerHTML
MDN Reference
inner Text
MDN Reference
input Mode
MDN Reference
Readonly
isReturns true if node is connected and false otherwise.
MDN Reference
Readonly
isMDN Reference
lang
MDN Reference
Readonly
lastReturns the last child.
MDN Reference
Readonly
lastReturns the last child that is an element, and null otherwise.
MDN Reference
Readonly
localReturns the local name.
MDN Reference
Readonly
namespaceURIReturns the namespace.
MDN Reference
Readonly
nextReturns the first following sibling that is an element, and null otherwise.
MDN Reference
Readonly
nextReturns the next sibling.
MDN Reference
Readonly
nodeReturns a string appropriate for the type of node.
MDN Reference
Readonly
nodeReturns the type of node.
MDN Reference
node Value
MDN Reference
Optional
nonceMDN Reference
Readonly
offsetMDN Reference
Readonly
offsetMDN Reference
Readonly
offsetMDN Reference
Readonly
offsetMDN Reference
Readonly
offsetMDN Reference
onabort
Fires when the user aborts the download.
Type declaration
Parameters
this: GlobalEventHandlers
ev: UIEvent
Returns any
Param
The event.
MDN Reference
onanimationcancel
MDN Reference
Type declaration
Parameters
this: GlobalEventHandlers
ev: AnimationEvent
Returns any
onanimationend
MDN Reference
Type declaration
Parameters
this: GlobalEventHandlers
ev: AnimationEvent
Returns any
onanimationiteration
MDN Reference
Type declaration
Parameters
this: GlobalEventHandlers
ev: AnimationEvent
Returns any
onanimationstart
MDN Reference
Type declaration
Parameters
this: GlobalEventHandlers
ev: AnimationEvent
Returns any
onauxclick
MDN Reference
Type declaration
Parameters
this: GlobalEventHandlers
ev: MouseEvent
Returns any
onbeforeinput
MDN Reference
Type declaration
Parameters
this: GlobalEventHandlers
ev: InputEvent
Returns any
onblur
Fires when the object loses the input focus.
Type declaration
Parameters
this: GlobalEventHandlers
ev: FocusEvent
Returns any
Param
The focus event.
MDN Reference
oncancel
MDN Reference
Type declaration
Parameters
this: GlobalEventHandlers
ev: Event
Returns any
oncanplay
Occurs when playback is possible, but would require further buffering.
Type declaration
Parameters
this: GlobalEventHandlers
ev: Event
Returns any
Param
The event.
MDN Reference
oncanplaythrough
MDN Reference
Type declaration
Parameters
this: GlobalEventHandlers
ev: Event
Returns any
onchange
Fires when the contents of the object or selection have changed.
Type declaration
Parameters
this: GlobalEventHandlers
ev: Event
Returns any
Param
The event.
MDN Reference
onclick
Fires when the user clicks the left mouse button on the object
Type declaration
Parameters
this: GlobalEventHandlers
ev: MouseEvent
Returns any
Param
The mouse event.
MDN Reference
onclose
MDN Reference
Type declaration
Parameters
this: GlobalEventHandlers
ev: Event
Returns any
oncontextmenu
Fires when the user clicks the right mouse button in the client area, opening the context menu.
Type declaration
Parameters
this: GlobalEventHandlers
ev: MouseEvent
Returns any
Param
The mouse event.
MDN Reference
oncopy
MDN Reference
Type declaration
Parameters
this: GlobalEventHandlers
ev: ClipboardEvent
Returns any
oncuechange
MDN Reference
Type declaration
Parameters
this: GlobalEventHandlers
ev: Event
Returns any
oncut
MDN Reference
Type declaration
Parameters
this: GlobalEventHandlers
ev: ClipboardEvent
Returns any
ondblclick
Fires when the user double-clicks the object.
Type declaration
Parameters
this: GlobalEventHandlers
ev: MouseEvent
Returns any
Param
The mouse event.
MDN Reference
ondrag
Fires on the source object continuously during a drag operation.
Type declaration
Parameters
this: GlobalEventHandlers
ev: DragEvent
Returns any
Param
The event.
MDN Reference
ondragend
Fires on the source object when the user releases the mouse at the close of a drag operation.
Type declaration
Parameters
this: GlobalEventHandlers
ev: DragEvent
Returns any
Param
The event.
MDN Reference
ondragenter
Fires on the target element when the user drags the object to a valid drop target.
Type declaration
Parameters
this: GlobalEventHandlers
ev: DragEvent
Returns any
Param
The drag event.
MDN Reference
ondragleave
Fires on the target object when the user moves the mouse out of a valid drop target during a drag operation.
Type declaration
Parameters
this: GlobalEventHandlers
ev: DragEvent
Returns any
Param
The drag event.
MDN Reference
ondragover
Fires on the target element continuously while the user drags the object over a valid drop target.
Type declaration
Parameters
this: GlobalEventHandlers
ev: DragEvent
Returns any
Param
The event.
MDN Reference
ondragstart
Fires on the source object when the user starts to drag a text selection or selected object.
Type declaration
Parameters
this: GlobalEventHandlers
ev: DragEvent
Returns any
Param
The event.
MDN Reference
ondrop
MDN Reference
Type declaration
Parameters
this: GlobalEventHandlers
ev: DragEvent
Returns any
ondurationchange
Occurs when the duration attribute is updated.
Type declaration
Parameters
this: GlobalEventHandlers
ev: Event
Returns any
Param
The event.
MDN Reference
onemptied
Occurs when the media element is reset to its initial state.
Type declaration
Parameters
this: GlobalEventHandlers
ev: Event
Returns any
Param
The event.
MDN Reference
onended
Occurs when the end of playback is reached.
Type declaration
Parameters
this: GlobalEventHandlers
ev: Event
Returns any
Param
The event
MDN Reference
onerror
Fires when an error occurs during object loading.
Param
The event.
MDN Reference
onfocus
Fires when the object receives focus.
Type declaration
Parameters
this: GlobalEventHandlers
ev: FocusEvent
Returns any
Param
The event.
MDN Reference
onformdata
MDN Reference
Type declaration
Parameters
this: GlobalEventHandlers
ev: FormDataEvent
Returns any
onfullscreenchange
MDN Reference
Type declaration
Parameters
this: Element
ev: Event
Returns any
onfullscreenerror
MDN Reference
Type declaration
Parameters
this: Element
ev: Event
Returns any
ongotpointercapture
MDN Reference
Type declaration
Parameters
this: GlobalEventHandlers
ev: PointerEvent
Returns any
oninput
MDN Reference
Type declaration
Parameters
this: GlobalEventHandlers
ev: Event
Returns any
oninvalid
MDN Reference
Type declaration
Parameters
this: GlobalEventHandlers
ev: Event
Returns any
onkeydown
Fires when the user presses a key.
Type declaration
Parameters
this: GlobalEventHandlers
ev: KeyboardEvent
Returns any
Param
The keyboard event
MDN Reference
onkeypress
Fires when the user presses an alphanumeric key.
Type declaration
Parameters
this: GlobalEventHandlers
ev: KeyboardEvent
Returns any
Param
The event.
Deprecated
MDN Reference
onkeyup
Fires when the user releases a key.
Type declaration
Parameters
this: GlobalEventHandlers
ev: KeyboardEvent
Returns any
Param
The keyboard event
MDN Reference
onload
Fires immediately after the browser loads the object.
Type declaration
Parameters
this: GlobalEventHandlers
ev: Event
Returns any
Param
The event.
MDN Reference
onloadeddata
Occurs when media data is loaded at the current playback position.
Type declaration
Parameters
this: GlobalEventHandlers
ev: Event
Returns any
Param
The event.
MDN Reference
onloadedmetadata
Occurs when the duration and dimensions of the media have been determined.
Type declaration
Parameters
this: GlobalEventHandlers
ev: Event
Returns any
Param
The event.
MDN Reference
onloadstart
Occurs when Internet Explorer begins looking for media data.
Type declaration
Parameters
this: GlobalEventHandlers
ev: Event
Returns any
Param
The event.
MDN Reference
onlostpointercapture
MDN Reference
Type declaration
Parameters
this: GlobalEventHandlers
ev: PointerEvent
Returns any
onmousedown
Fires when the user clicks the object with either mouse button.
Type declaration
Parameters
this: GlobalEventHandlers
ev: MouseEvent
Returns any
Param
The mouse event.
MDN Reference
onmouseenter
MDN Reference
Type declaration
Parameters
this: GlobalEventHandlers
ev: MouseEvent
Returns any
onmouseleave
MDN Reference
Type declaration
Parameters
this: GlobalEventHandlers
ev: MouseEvent
Returns any
onmousemove
Fires when the user moves the mouse over the object.
Type declaration
Parameters
this: GlobalEventHandlers
ev: MouseEvent
Returns any
Param
The mouse event.
MDN Reference
onmouseout
Fires when the user moves the mouse pointer outside the boundaries of the object.
Type declaration
Parameters
this: GlobalEventHandlers
ev: MouseEvent
Returns any
Param
The mouse event.
MDN Reference
onmouseover
Fires when the user moves the mouse pointer into the object.
Type declaration
Parameters
this: GlobalEventHandlers
ev: MouseEvent
Returns any
Param
The mouse event.
MDN Reference
onmouseup
Fires when the user releases a mouse button while the mouse is over the object.
Type declaration
Parameters
this: GlobalEventHandlers
ev: MouseEvent
Returns any
Param
The mouse event.
MDN Reference
onpaste
MDN Reference
Type declaration
Parameters
this: GlobalEventHandlers
ev: ClipboardEvent
Returns any
onpause
Occurs when playback is paused.
Type declaration
Parameters
this: GlobalEventHandlers
ev: Event
Returns any
Param
The event.
MDN Reference
onplay
Occurs when the play method is requested.
Type declaration
Parameters
this: GlobalEventHandlers
ev: Event
Returns any
Param
The event.
MDN Reference
onplaying
Occurs when the audio or video has started playing.
Type declaration
Parameters
this: GlobalEventHandlers
ev: Event
Returns any
Param
The event.
MDN Reference
onpointercancel
MDN Reference
Type declaration
Parameters
this: GlobalEventHandlers
ev: PointerEvent
Returns any
onpointerdown
MDN Reference
Type declaration
Parameters
this: GlobalEventHandlers
ev: PointerEvent
Returns any
onpointerenter
MDN Reference
Type declaration
Parameters
this: GlobalEventHandlers
ev: PointerEvent
Returns any
onpointerleave
MDN Reference
Type declaration
Parameters
this: GlobalEventHandlers
ev: PointerEvent
Returns any
onpointermove
MDN Reference
Type declaration
Parameters
this: GlobalEventHandlers
ev: PointerEvent
Returns any
onpointerout
MDN Reference
Type declaration
Parameters
this: GlobalEventHandlers
ev: PointerEvent
Returns any
onpointerover
MDN Reference
Type declaration
Parameters
this: GlobalEventHandlers
ev: PointerEvent
Returns any
onpointerup
MDN Reference
Type declaration
Parameters
this: GlobalEventHandlers
ev: PointerEvent
Returns any
onprogress
Occurs to indicate progress while downloading media data.
Type declaration
Parameters
this: GlobalEventHandlers
ev: ProgressEvent<EventTarget>
Returns any
Param
The event.
MDN Reference
onratechange
Occurs when the playback rate is increased or decreased.
Type declaration
Parameters
this: GlobalEventHandlers
ev: Event
Returns any
Param
The event.
MDN Reference
onreset
Fires when the user resets a form.
Type declaration
Parameters
this: GlobalEventHandlers
ev: Event
Returns any
Param
The event.
MDN Reference
onresize
MDN Reference
Type declaration
Parameters
this: GlobalEventHandlers
ev: UIEvent
Returns any
onscroll
Fires when the user repositions the scroll box in the scroll bar on the object.
Type declaration
Parameters
this: GlobalEventHandlers
ev: Event
Returns any
Param
The event.
MDN Reference
onscrollend
MDN Reference
Type declaration
Parameters
this: GlobalEventHandlers
ev: Event
Returns any
onsecuritypolicyviolation
MDN Reference
Type declaration
Parameters
this: GlobalEventHandlers
ev: SecurityPolicyViolationEvent
Returns any
onseeked
Occurs when the seek operation ends.
Type declaration
Parameters
this: GlobalEventHandlers
ev: Event
Returns any
Param
The event.
MDN Reference
onseeking
Occurs when the current playback position is moved.
Type declaration
Parameters
this: GlobalEventHandlers
ev: Event
Returns any
Param
The event.
MDN Reference
onselect
Fires when the current selection changes.
Type declaration
Parameters
this: GlobalEventHandlers
ev: Event
Returns any
Param
The event.
MDN Reference
onselectionchange
MDN Reference
Type declaration
Parameters
this: GlobalEventHandlers
ev: Event
Returns any
onselectstart
MDN Reference
Type declaration
Parameters
this: GlobalEventHandlers
ev: Event
Returns any
onslotchange
MDN Reference
Type declaration
Parameters
this: GlobalEventHandlers
ev: Event
Returns any
onstalled
Occurs when the download has stopped.
Type declaration
Parameters
this: GlobalEventHandlers
ev: Event
Returns any
Param
The event.
MDN Reference
onsubmit
MDN Reference
Type declaration
Parameters
this: GlobalEventHandlers
ev: SubmitEvent
Returns any
onsuspend
Occurs if the load operation has been intentionally halted.
Type declaration
Parameters
this: GlobalEventHandlers
ev: Event
Returns any
Param
The event.
MDN Reference
ontimeupdate
Occurs to indicate the current playback position.
Type declaration
Parameters
this: GlobalEventHandlers
ev: Event
Returns any
Param
The event.
MDN Reference
ontoggle
MDN Reference
Type declaration
Parameters
this: GlobalEventHandlers
ev: Event
Returns any
Optional
ontouchcancelMDN Reference
Type declaration
Parameters
this: GlobalEventHandlers
ev: TouchEvent
Returns any
Optional
ontouchendMDN Reference
Type declaration
Parameters
this: GlobalEventHandlers
ev: TouchEvent
Returns any
Optional
ontouchmoveMDN Reference
Type declaration
Parameters
this: GlobalEventHandlers
ev: TouchEvent
Returns any
Optional
ontouchstartMDN Reference
Type declaration
Parameters
this: GlobalEventHandlers
ev: TouchEvent
Returns any
ontransitioncancel
MDN Reference
Type declaration
Parameters
this: GlobalEventHandlers
ev: TransitionEvent
Returns any
ontransitionend
MDN Reference
Type declaration
Parameters
this: GlobalEventHandlers
ev: TransitionEvent
Returns any
ontransitionrun
MDN Reference
Type declaration
Parameters
this: GlobalEventHandlers
ev: TransitionEvent
Returns any
ontransitionstart
MDN Reference
Type declaration
Parameters
this: GlobalEventHandlers
ev: TransitionEvent
Returns any
onvolumechange
Occurs when the volume is changed, or playback is muted or unmuted.
Type declaration
Parameters
this: GlobalEventHandlers
ev: Event
Returns any
Param
The event.
MDN Reference
onwaiting
Occurs when playback stops because the next frame of a video resource is not available.
Type declaration
Parameters
this: GlobalEventHandlers
ev: Event
Returns any
Param
The event.
MDN Reference
onwebkitanimationend
Type declaration
Parameters
this: GlobalEventHandlers
ev: Event
Returns any
Deprecated
This is a legacy alias of
onanimationend
.MDN Reference
onwebkitanimationiteration
Type declaration
Parameters
this: GlobalEventHandlers
ev: Event
Returns any
Deprecated
This is a legacy alias of
onanimationiteration
.MDN Reference
onwebkitanimationstart
Type declaration
Parameters
this: GlobalEventHandlers
ev: Event
Returns any
Deprecated
This is a legacy alias of
onanimationstart
.MDN Reference
onwebkittransitionend
Type declaration
Parameters
this: GlobalEventHandlers
ev: Event
Returns any
Deprecated
This is a legacy alias of
ontransitionend
.MDN Reference
onwheel
MDN Reference
Type declaration
Parameters
this: GlobalEventHandlers
ev: WheelEvent
Returns any
outerHTML
MDN Reference
outer Text
MDN Reference
Readonly
ownerReadonly
parentReturns the parent element.
MDN Reference
Readonly
parentReturns the parent.
MDN Reference
Readonly
partMDN Reference
popover
MDN Reference
Readonly
prefixReturns the namespace prefix.
MDN Reference
Readonly
previousReturns the first preceding sibling that is an element, and null otherwise.
MDN Reference
Readonly
previousReturns the previous sibling.
MDN Reference
role
Readonly
scrollMDN Reference
scroll Left
MDN Reference
scroll Top
MDN Reference
Readonly
scrollMDN Reference
Readonly
shadowReturns element's shadow root, if any, and if shadow root's mode is "open", and null otherwise.
MDN Reference
slot
Returns the value of element's slot content attribute. Can be set to change it.
MDN Reference
spellcheck
MDN Reference
Readonly
styleMDN Reference
tab Index
MDN Reference
Readonly
tagReturns the HTML-uppercased qualified name.
MDN Reference
text Content
MDN Reference
title
MDN Reference
translate
Methods
add Event Listener
Type Parameters
K extends keyof HTMLElementEventMap
Parameters
type: K
listener: ((this, ev) => any)
Parameters
this: HTMLDivElement
ev: HTMLElementEventMap[K]
Returns any
Optional
options: boolean | AddEventListenerOptionsReturns void
Parameters
type: string
listener: EventListenerOrEventListenerObject
Optional
options: boolean | AddEventListenerOptionsReturns 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.
MDN Reference
Parameters
Rest
...nodes: (string | Node)[]Returns void
animate
MDN Reference
Parameters
keyframes: null | Keyframe[] | PropertyIndexedKeyframes
Optional
options: number | KeyframeAnimationOptionsReturns 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.
MDN Reference
Parameters
Rest
...nodes: (string | Node)[]Returns void
append Child
MDN Reference
Type Parameters
T extends Node
Parameters
node: T
Returns T
attach Internals
MDN Reference
Returns ElementInternals
attach Shadow
Creates a shadow root for element and returns it.
MDN Reference
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.
MDN Reference
Parameters
Rest
...nodes: (string | Node)[]Returns void
blur
MDN Reference
Returns void
check Visibility
Parameters
Optional
options: CheckVisibilityOptionsReturns boolean
click
MDN Reference
Returns void
clone Node
Returns a copy of node. If deep is true, the copy also includes the node's descendants.
MDN Reference
Parameters
Optional
deep: booleanReturns Node
closest
Returns the first (starting at element) inclusive ancestor that matches selectors, and null otherwise.
MDN Reference
Type Parameters
K extends keyof HTMLElementTagNameMap
Parameters
selector: K
Returns null | HTMLElementTagNameMap[K]
Type Parameters
K extends keyof SVGElementTagNameMap
Parameters
selector: K
Returns null | SVGElementTagNameMap[K]
Type Parameters
K extends keyof MathMLElementTagNameMap
Parameters
selector: K
Returns null | MathMLElementTagNameMap[K]
Type Parameters
E extends Element = Element
Parameters
selectors: string
Returns null | E
compare Document Position
Returns a bitmask indicating the position of other relative to node.
MDN Reference
Parameters
other: Node
Returns number
computed Style Map
MDN Reference
Returns StylePropertyMapReadOnly
contains
Returns true if other is an inclusive descendant of node, and false otherwise.
MDN Reference
Parameters
other: null | Node
Returns boolean
dispatch Event
Dispatches a synthetic event event to target and returns true if either event's cancelable attribute value is false or its preventDefault() method was not invoked, and false otherwise.
MDN Reference
Parameters
event: Event
Returns boolean
focus
MDN Reference
Parameters
Optional
options: FocusOptionsReturns void
get Animations
MDN Reference
Parameters
Optional
options: GetAnimationsOptionsReturns Animation[]
get Attribute
Returns element's first attribute whose qualified name is qualifiedName, and null if there is no such attribute otherwise.
MDN Reference
Parameters
qualifiedName: string
Returns null | string
get AttributeNS
Returns element's attribute whose namespace is namespace and local name is localName, and null if there is no such attribute otherwise.
MDN Reference
Parameters
namespace: null | string
localName: string
Returns null | string
get Attribute Names
Returns the qualified names of all element's attributes. Can contain duplicates.
MDN Reference
Returns string[]
get Attribute Node
MDN Reference
Parameters
qualifiedName: string
Returns null | Attr
get Attribute NodeNS
MDN Reference
Parameters
namespace: null | string
localName: string
Returns null | Attr
get Bounding Client Rect
MDN Reference
Returns DOMRect
get Client Rects
MDN Reference
Returns DOMRectList
get Elements By Class Name
Returns a HTMLCollection of the elements in the object on which the method was invoked (a document or an element) that have all the classes given by classNames. The classNames argument is interpreted as a space-separated list of classes.
MDN Reference
Parameters
classNames: string
Returns HTMLCollectionOf<Element>
get Elements By Tag Name
MDN Reference
Type Parameters
K extends keyof HTMLElementTagNameMap
Parameters
qualifiedName: K
Returns HTMLCollectionOf<HTMLElementTagNameMap[K]>
Type Parameters
K extends keyof SVGElementTagNameMap
Parameters
qualifiedName: K
Returns HTMLCollectionOf<SVGElementTagNameMap[K]>
Type Parameters
K extends keyof MathMLElementTagNameMap
Parameters
qualifiedName: K
Returns HTMLCollectionOf<MathMLElementTagNameMap[K]>
Type Parameters
K extends keyof HTMLElementDeprecatedTagNameMap
Parameters
qualifiedName: K
Returns HTMLCollectionOf<HTMLElementDeprecatedTagNameMap[K]>
Deprecated
Parameters
qualifiedName: string
Returns HTMLCollectionOf<Element>
get Elements By Tag NameNS
MDN Reference
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: "http://www.w3.org/1998/Math/MathML"
localName: string
Returns HTMLCollectionOf<MathMLElement>
Parameters
namespace: null | string
localName: string
Returns HTMLCollectionOf<Element>
get Root Node
Returns node's root.
MDN Reference
Parameters
Optional
options: GetRootNodeOptionsReturns Node
has Attribute
Returns true if element has an attribute whose qualified name is qualifiedName, and false otherwise.
MDN Reference
Parameters
qualifiedName: string
Returns boolean
has AttributeNS
Returns true if element has an attribute whose namespace is namespace and local name is localName.
MDN Reference
Parameters
namespace: null | string
localName: string
Returns boolean
has Attributes
Returns true if element has attributes, and false otherwise.
MDN Reference
Returns boolean
has Child Nodes
Returns whether node has children.
MDN Reference
Returns boolean
has Pointer Capture
MDN Reference
Parameters
pointerId: number
Returns boolean
hide Popover
MDN Reference
Returns void
insert Adjacent Element
MDN Reference
Parameters
where: InsertPosition
element: Element
Returns null | Element
insert AdjacentHTML
MDN Reference
Parameters
position: InsertPosition
text: string
Returns void
insert Adjacent Text
MDN Reference
Parameters
where: InsertPosition
data: string
Returns void
insert Before
MDN Reference
Type Parameters
T extends Node
Parameters
node: T
child: null | Node
Returns T
is Default Namespace
MDN Reference
Parameters
namespace: null | string
Returns boolean
is Equal Node
Returns whether node and otherNode have the same properties.
MDN Reference
Parameters
otherNode: null | Node
Returns boolean
is Same Node
MDN Reference
Parameters
otherNode: null | Node
Returns boolean
lookup NamespaceURI
MDN Reference
Parameters
prefix: null | string
Returns null | string
lookup Prefix
MDN Reference
Parameters
namespace: null | string
Returns null | string
matches
Returns true if matching selectors against element's root yields element, and false otherwise.
MDN Reference
Parameters
selectors: string
Returns boolean
normalize
Removes empty exclusive Text nodes and concatenates the data of remaining contiguous exclusive Text nodes into the first of their nodes.
MDN Reference
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.
MDN Reference
Parameters
Rest
...nodes: (string | Node)[]Returns void
query Selector
Returns the first element that is a descendant of node that matches selectors.
MDN Reference
Type Parameters
K extends keyof HTMLElementTagNameMap
Parameters
selectors: K
Returns null | HTMLElementTagNameMap[K]
Type Parameters
K extends keyof SVGElementTagNameMap
Parameters
selectors: K
Returns null | SVGElementTagNameMap[K]
Type Parameters
K extends keyof MathMLElementTagNameMap
Parameters
selectors: K
Returns null | MathMLElementTagNameMap[K]
Type Parameters
K extends keyof HTMLElementDeprecatedTagNameMap
Parameters
selectors: K
Returns null | HTMLElementDeprecatedTagNameMap[K]
Deprecated
Type Parameters
E extends Element = Element
Parameters
selectors: string
Returns null | E
query Selector All
Returns all element descendants of node that match selectors.
MDN Reference
Type Parameters
K extends keyof HTMLElementTagNameMap
Parameters
selectors: K
Returns NodeListOf<HTMLElementTagNameMap[K]>
Type Parameters
K extends keyof SVGElementTagNameMap
Parameters
selectors: K
Returns NodeListOf<SVGElementTagNameMap[K]>
Type Parameters
K extends keyof MathMLElementTagNameMap
Parameters
selectors: K
Returns NodeListOf<MathMLElementTagNameMap[K]>
Type Parameters
K extends keyof HTMLElementDeprecatedTagNameMap
Parameters
selectors: K
Returns NodeListOf<HTMLElementDeprecatedTagNameMap[K]>
Deprecated
Type Parameters
E extends Element = Element
Parameters
selectors: string
Returns NodeListOf<E>
release Pointer Capture
MDN Reference
Parameters
pointerId: number
Returns void
remove
Removes node.
MDN Reference
Returns void
remove Attribute
Removes element's first attribute whose qualified name is qualifiedName.
MDN Reference
Parameters
qualifiedName: string
Returns void
remove AttributeNS
Removes element's attribute whose namespace is namespace and local name is localName.
MDN Reference
Parameters
namespace: null | string
localName: string
Returns void
remove Attribute Node
MDN Reference
Parameters
attr: Attr
Returns Attr
remove Child
MDN Reference
Type Parameters
T extends Node
Parameters
child: T
Returns T
remove Event Listener
Type Parameters
K extends keyof HTMLElementEventMap
Parameters
type: K
listener: ((this, ev) => any)
Parameters
this: HTMLDivElement
ev: HTMLElementEventMap[K]
Returns any
Optional
options: boolean | EventListenerOptionsReturns void
Parameters
type: string
listener: EventListenerOrEventListenerObject
Optional
options: boolean | EventListenerOptionsReturns void
replace Child
MDN Reference
Type Parameters
T extends Node
Parameters
node: Node
child: T
Returns T
replace Children
Replace all children of node with nodes, while replacing strings in nodes with equivalent Text nodes.
Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated.
MDN Reference
Parameters
Rest
...nodes: (string | Node)[]Returns void
replace With
Replaces node with nodes, while replacing strings in nodes with equivalent Text nodes.
Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated.
MDN Reference
Parameters
Rest
...nodes: (string | Node)[]Returns void
request Fullscreen
Displays element fullscreen and resolves promise when done.
When supplied, options's navigationUI member indicates whether showing navigation UI while in fullscreen is preferred or not. If set to "show", navigation simplicity is preferred over screen space, and if set to "hide", more screen space is preferred. User agents are always free to honor user preference over the application's. The default value "auto" indicates no application preference.
MDN Reference
Parameters
Optional
options: FullscreenOptionsReturns Promise<void>
request Pointer Lock
MDN Reference
Returns void
scroll
MDN Reference
Parameters
Optional
options: ScrollToOptionsReturns void
Parameters
x: number
y: number
Returns void
scroll By
MDN Reference
Parameters
Optional
options: ScrollToOptionsReturns void
Parameters
x: number
y: number
Returns void
scroll Into View
MDN Reference
Parameters
Optional
arg: boolean | ScrollIntoViewOptionsReturns void
scroll To
MDN Reference
Parameters
Optional
options: ScrollToOptionsReturns void
Parameters
x: number
y: number
Returns void
set Attribute
Sets the value of element's first attribute whose qualified name is qualifiedName to value.
MDN Reference
Parameters
qualifiedName: string
value: string
Returns void
set AttributeNS
Sets the value of element's attribute whose namespace is namespace and local name is localName to value.
MDN Reference
Parameters
namespace: null | string
qualifiedName: string
value: string
Returns void
set Attribute Node
MDN Reference
Parameters
attr: Attr
Returns null | Attr
set Attribute NodeNS
MDN Reference
Parameters
attr: Attr
Returns null | Attr
set Pointer Capture
MDN Reference
Parameters
pointerId: number
Returns void
show Popover
MDN Reference
Returns void
toggle Attribute
If force is not given, "toggles" qualifiedName, removing it if it is present and adding it if it is not present. If force is true, adds qualifiedName. If force is false, removes qualifiedName.
Returns true if qualifiedName is now present, and false otherwise.
MDN Reference
Parameters
qualifiedName: string
Optional
force: booleanReturns boolean
toggle Popover
MDN Reference
Parameters
Optional
force: booleanReturns void
webkit Matches Selector
Parameters
selectors: string
Returns boolean
Deprecated
This is a legacy alias of
matches
.MDN Reference
Settings
Member Visibility
Theme
On This Page