HTMLMapElement
Values
addEventListener
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.Read more on MDN
letaddEventListener: (WebAPI.DOMAPI.htmlMapElement,WebAPI.EventAPI.eventType,WebAPI.EventAPI.eventListener<'event>,~options:WebAPI.EventAPI.addEventListenerOptions=?,)=>unitParameters
WebAPI.DOMAPI.htmlMapElementWebAPI.EventAPI.eventTypeWebAPI.EventAPI.eventListener option<WebAPI.EventAPI.addEventListenerOptions >Return type
unitaddEventListenerWithCapture
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.Read more on MDN
letaddEventListenerWithCapture: (WebAPI.DOMAPI.htmlMapElement,WebAPI.EventAPI.eventType,WebAPI.EventAPI.eventListener<'event>,)=>unitParameters
WebAPI.DOMAPI.htmlMapElementWebAPI.EventAPI.eventTypeWebAPI.EventAPI.eventListenerReturn type
unitafter
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.Read more on MDN
letafter: (WebAPI.DOMAPI.htmlMapElement,WebAPI.DOMAPI.node)=>unitafter2
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.Read more on MDN
letafter2: (WebAPI.DOMAPI.htmlMapElement,string)=>unitanimate
letanimate: (WebAPI.DOMAPI.htmlMapElement,~keyframes:WebAPI.Prelude.any,~options:float=?,)=>WebAPI.DOMAPI.animationParameters
WebAPI.DOMAPI.htmlMapElementWebAPI.Prelude.any option< float >Return type
WebAPI.DOMAPI.animationanimate2
letanimate2: (WebAPI.DOMAPI.htmlMapElement,~keyframes:WebAPI.Prelude.any,~options:WebAPI.DOMAPI.keyframeAnimationOptions=?,)=>WebAPI.DOMAPI.animationParameters
WebAPI.DOMAPI.htmlMapElementWebAPI.Prelude.any option<WebAPI.DOMAPI.keyframeAnimationOptions >Return type
WebAPI.DOMAPI.animationappend
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.Read more on MDN
letappend: (WebAPI.DOMAPI.htmlMapElement,WebAPI.DOMAPI.node)=>unitappend2
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.Read more on MDN
letappend2: (WebAPI.DOMAPI.htmlMapElement,string)=>unitasElement
letasElement:WebAPI.DOMAPI.htmlMapElement=>WebAPI.DOMAPI.elementasEventTarget
letasEventTarget:WebAPI.DOMAPI.htmlMapElement=>WebAPI.EventAPI.eventTargetasHTMLElement
letasHTMLElement:WebAPI.DOMAPI.htmlMapElement=>WebAPI.DOMAPI.htmlElementasNode
letasNode:WebAPI.DOMAPI.htmlMapElement=>WebAPI.DOMAPI.nodeattachInternals
letattachInternals:WebAPI.DOMAPI.htmlMapElement=>WebAPI.DOMAPI.elementInternalsattachShadow
Creates a shadow root for element and returns it.Read more on MDN
letattachShadow: (WebAPI.DOMAPI.htmlMapElement,WebAPI.DOMAPI.shadowRootInit,)=>WebAPI.DOMAPI.shadowRootParameters
WebAPI.DOMAPI.htmlMapElementWebAPI.DOMAPI.shadowRootInitReturn type
WebAPI.DOMAPI.shadowRootbefore
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.Read more on MDN
letbefore: (WebAPI.DOMAPI.htmlMapElement,WebAPI.DOMAPI.node)=>unitbefore2
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.Read more on MDN
letbefore2: (WebAPI.DOMAPI.htmlMapElement,string)=>unitblur
letblur:WebAPI.DOMAPI.htmlMapElement=>unitcheckVisibility
letcheckVisibility: (WebAPI.DOMAPI.htmlMapElement,~options:WebAPI.DOMAPI.checkVisibilityOptions=?,)=>boolParameters
WebAPI.DOMAPI.htmlMapElement option<WebAPI.DOMAPI.checkVisibilityOptions >Return type
boolclick
letclick:WebAPI.DOMAPI.htmlMapElement=>unitcloneNode
Returns a copy of node. If deep is true, the copy also includes the node's descendants.Read more on MDN
letcloneNode: (WebAPI.DOMAPI.htmlMapElement,~deep:bool=?,)=>WebAPI.DOMAPI.htmlMapElementclosest
Returns the first (starting at element) inclusive ancestor that matches selectors, and null otherwise.Read more on MDN
letclosest: (WebAPI.DOMAPI.htmlMapElement,string)=>'ecompareDocumentPosition
Returns a bitmask indicating the position of other relative to node.Read more on MDN
letcompareDocumentPosition: (WebAPI.DOMAPI.htmlMapElement,WebAPI.DOMAPI.node)=>intcomputedStyleMap
letcomputedStyleMap:WebAPI.DOMAPI.htmlMapElement=>WebAPI.DOMAPI.stylePropertyMapReadOnlycontains
Returns true if other is an inclusive descendant of node, and false otherwise.Read more on MDN
letcontains: (WebAPI.DOMAPI.htmlMapElement,WebAPI.DOMAPI.node)=>booldispatchEvent
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.Read more on MDN
letdispatchEvent: (WebAPI.DOMAPI.htmlMapElement,WebAPI.EventAPI.event,)=>boolfocus
letfocus: (WebAPI.DOMAPI.htmlMapElement,~options:WebAPI.DOMAPI.focusOptions=?,)=>unitgetAnimations
letgetAnimations: (WebAPI.DOMAPI.htmlMapElement,~options:WebAPI.DOMAPI.getAnimationsOptions=?,)=>array<WebAPI.DOMAPI.animation>Parameters
WebAPI.DOMAPI.htmlMapElement option<WebAPI.DOMAPI.getAnimationsOptions >Return type
array<WebAPI.DOMAPI.animation >getAttribute
Returns element's first attribute whose qualified name is qualifiedName, and null if there is no such attribute otherwise.Read more on MDN
letgetAttribute: (WebAPI.DOMAPI.htmlMapElement,string)=>null<string>getAttributeNames
Returns the qualified names of all element's attributes. Can contain duplicates.Read more on MDN
letgetAttributeNames:WebAPI.DOMAPI.htmlMapElement=>array<string>getAttributeNode
letgetAttributeNode: (WebAPI.DOMAPI.htmlMapElement,string)=>WebAPI.DOMAPI.attrgetAttributeNodeNS
letgetAttributeNodeNS: (WebAPI.DOMAPI.htmlMapElement,~namespace:string,~localName:string,)=>WebAPI.DOMAPI.attrgetAttributeNS
Returns element's attribute whose namespace is namespace and local name is localName, and null if there is no such attribute otherwise.Read more on MDN
letgetAttributeNS: (WebAPI.DOMAPI.htmlMapElement,~namespace:string,~localName:string,)=>stringgetBoundingClientRect
letgetBoundingClientRect:WebAPI.DOMAPI.htmlMapElement=>WebAPI.DOMAPI.domRectgetClientRects
letgetClientRects:WebAPI.DOMAPI.htmlMapElement=>WebAPI.DOMAPI.domRectListgetElementsByClassName
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.Read more on MDN
letgetElementsByClassName: (WebAPI.DOMAPI.htmlMapElement,string,)=>WebAPI.DOMAPI.htmlCollectionOf<WebAPI.DOMAPI.element>Parameters
WebAPI.DOMAPI.htmlMapElement stringReturn type
WebAPI.DOMAPI.htmlCollectionOf<WebAPI.DOMAPI.element >getElementsByTagName
letgetElementsByTagName: (WebAPI.DOMAPI.htmlMapElement,string,)=>WebAPI.DOMAPI.htmlCollectiongetElementsByTagNameNS
letgetElementsByTagNameNS: (WebAPI.DOMAPI.element,~namespace:string,~localName:string,)=>WebAPI.DOMAPI.htmlCollectionOf<WebAPI.DOMAPI.element>Parameters
WebAPI.DOMAPI.element string stringReturn type
WebAPI.DOMAPI.htmlCollectionOf<WebAPI.DOMAPI.element >getHTML
letgetHTML: (WebAPI.DOMAPI.htmlMapElement,~options:WebAPI.DOMAPI.getHTMLOptions=?,)=>stringgetRootNode
Returns node's root.Read more on MDN
letgetRootNode: (WebAPI.DOMAPI.htmlMapElement,~options:WebAPI.DOMAPI.getRootNodeOptions=?,)=>WebAPI.DOMAPI.nodeParameters
WebAPI.DOMAPI.htmlMapElement option<WebAPI.DOMAPI.getRootNodeOptions >Return type
WebAPI.DOMAPI.nodehasAttribute
Returns true if element has an attribute whose qualified name is qualifiedName, and false otherwise.Read more on MDN
lethasAttribute: (WebAPI.DOMAPI.htmlMapElement,string)=>boolhasAttributeNS
Returns true if element has an attribute whose namespace is namespace and local name is localName.Read more on MDN
lethasAttributeNS: (WebAPI.DOMAPI.htmlMapElement,~namespace:string,~localName:string,)=>boolhasAttributes
Returns true if element has attributes, and false otherwise.Read more on MDN
lethasAttributes:WebAPI.DOMAPI.htmlMapElement=>boolhasChildNodes
Returns whether node has children.Read more on MDN
lethasChildNodes:WebAPI.DOMAPI.htmlMapElement=>boolhasPointerCapture
lethasPointerCapture: (WebAPI.DOMAPI.htmlMapElement,int)=>boolhidePopover
lethidePopover:WebAPI.DOMAPI.htmlMapElement=>unitinsertAdjacentElement
letinsertAdjacentElement: (WebAPI.DOMAPI.htmlMapElement,~where:WebAPI.DOMAPI.insertPosition,~element:WebAPI.DOMAPI.element,)=>WebAPI.DOMAPI.elementinsertAdjacentHTML
letinsertAdjacentHTML: (WebAPI.DOMAPI.htmlMapElement,~position:WebAPI.DOMAPI.insertPosition,~string:string,)=>unitinsertAdjacentText
letinsertAdjacentText: (WebAPI.DOMAPI.htmlMapElement,~where:WebAPI.DOMAPI.insertPosition,~data:string,)=>unitinsertBefore
letinsertBefore: (WebAPI.DOMAPI.htmlMapElement,'t,~child:WebAPI.DOMAPI.node,)=>'tisDefaultNamespace
letisDefaultNamespace: (WebAPI.DOMAPI.htmlMapElement,string)=>boolisEqualNode
Returns whether node and otherNode have the same properties.Read more on MDN
letisEqualNode: (WebAPI.DOMAPI.htmlMapElement,WebAPI.DOMAPI.node)=>boolisSameNode
letisSameNode: (WebAPI.DOMAPI.htmlMapElement,WebAPI.DOMAPI.node)=>boollookupNamespaceURI
letlookupNamespaceURI: (WebAPI.DOMAPI.htmlMapElement,string)=>stringlookupPrefix
letlookupPrefix: (WebAPI.DOMAPI.htmlMapElement,string)=>stringmatches
Returns true if matching selectors against element's root yields element, and false otherwise.Read more on MDN
letmatches: (WebAPI.DOMAPI.htmlMapElement,string)=>boolnormalize
Removes empty exclusive Text nodes and concatenates the data of remaining contiguous exclusive Text nodes into the first of their nodes.Read more on MDN
letnormalize:WebAPI.DOMAPI.htmlMapElement=>unitprepend
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.Read more on MDN
letprepend: (WebAPI.DOMAPI.htmlMapElement,WebAPI.DOMAPI.node)=>unitprepend2
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.Read more on MDN
letprepend2: (WebAPI.DOMAPI.htmlMapElement,string)=>unitquerySelector
Returns the first element that is a descendant of node that matches selectors.Read more on MDN
letquerySelector: (WebAPI.DOMAPI.htmlMapElement,string,)=>Null.t<WebAPI.DOMAPI.element>querySelectorAll
Returns all element descendants of node that match selectors.Read more on MDN
letquerySelectorAll: (WebAPI.DOMAPI.htmlMapElement,string,)=>WebAPI.DOMAPI.nodeListreleasePointerCapture
letreleasePointerCapture: (WebAPI.DOMAPI.htmlMapElement,int)=>unitremoveAttribute
Removes element's first attribute whose qualified name is qualifiedName.Read more on MDN
letremoveAttribute: (WebAPI.DOMAPI.htmlMapElement,string)=>unitremoveAttributeNode
letremoveAttributeNode: (WebAPI.DOMAPI.htmlMapElement,WebAPI.DOMAPI.attr,)=>WebAPI.DOMAPI.attrremoveAttributeNS
Removes element's attribute whose namespace is namespace and local name is localName.Read more on MDN
letremoveAttributeNS: (WebAPI.DOMAPI.htmlMapElement,~namespace:string,~localName:string,)=>unitremoveEventListener
Removes the event listener in target's event listener list with the same type, callback, and options.Read more on MDN
letremoveEventListener: (WebAPI.DOMAPI.htmlMapElement,WebAPI.EventAPI.eventType,WebAPI.EventAPI.eventListener<'event>,~options:WebAPI.EventAPI.eventListenerOptions=?,)=>unitParameters
WebAPI.DOMAPI.htmlMapElementWebAPI.EventAPI.eventTypeWebAPI.EventAPI.eventListener option<WebAPI.EventAPI.eventListenerOptions >Return type
unitremoveEventListener_useCapture
Removes the event listener in target's event listener list with the same type, callback, and options.Read more on MDN
letremoveEventListener_useCapture: (WebAPI.DOMAPI.htmlMapElement,WebAPI.EventAPI.eventType,WebAPI.EventAPI.eventListener<'event>,)=>unitParameters
WebAPI.DOMAPI.htmlMapElementWebAPI.EventAPI.eventTypeWebAPI.EventAPI.eventListenerReturn type
unitreplaceChild
letreplaceChild: (WebAPI.DOMAPI.htmlMapElement,~node:WebAPI.DOMAPI.node,'t,)=>'treplaceChildren
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.Read more on MDN
letreplaceChildren: (WebAPI.DOMAPI.htmlMapElement,WebAPI.DOMAPI.node)=>unitreplaceChildren2
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.Read more on MDN
letreplaceChildren2: (WebAPI.DOMAPI.htmlMapElement,string)=>unitreplaceWith
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.Read more on MDN
letreplaceWith: (WebAPI.DOMAPI.htmlMapElement,WebAPI.DOMAPI.node)=>unitreplaceWith2
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.Read more on MDN
letreplaceWith2: (WebAPI.DOMAPI.htmlMapElement,string)=>unitrequestFullscreen
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.Read more on MDN
letrequestFullscreen: (WebAPI.DOMAPI.htmlMapElement,~options:WebAPI.DOMAPI.fullscreenOptions=?,)=>promise<unit>Parameters
WebAPI.DOMAPI.htmlMapElement option<WebAPI.DOMAPI.fullscreenOptions >Return type
promise< unit >requestPointerLock
letrequestPointerLock: (WebAPI.DOMAPI.htmlMapElement,~options:WebAPI.DOMAPI.pointerLockOptions=?,)=>promise<unit>Parameters
WebAPI.DOMAPI.htmlMapElement option<WebAPI.DOMAPI.pointerLockOptions >Return type
promise< unit >scroll
letscroll: (WebAPI.DOMAPI.htmlMapElement,~options:WebAPI.DOMAPI.scrollToOptions=?,)=>unitscroll2
letscroll2: (WebAPI.DOMAPI.htmlMapElement, ~x:float, ~y:float)=>unitscrollBy
letscrollBy: (WebAPI.DOMAPI.htmlMapElement,~options:WebAPI.DOMAPI.scrollToOptions=?,)=>unitscrollBy2
letscrollBy2: (WebAPI.DOMAPI.htmlMapElement, ~x:float, ~y:float)=>unitscrollIntoView
scrollIntoView()
Scrolls the element's ancestor containers such that the element on which scrollIntoView() is called is visible to the user.
element->Element.scrollIntoView()letscrollIntoView:WebAPI.DOMAPI.htmlMapElement=>unitscrollIntoView_alignToTop
scrollIntoView(true)
Scrolls the element's ancestor containers such that the element on which scrollIntoView() is called is visible to the user.
element->Element.scrollIntoView_alignToTop()letscrollIntoView_alignToTop:WebAPI.DOMAPI.htmlMapElement=>unitscrollIntoViewWithOptions
scrollIntoView({ behavior: "smooth" })
Scrolls the element's ancestor containers such that the element on which scrollIntoView() is called is visible to the user.
element->Element.scrollIntoViewWithOptions({ behavior: DOMAPI.Smooth })letscrollIntoViewWithOptions: (WebAPI.DOMAPI.htmlMapElement,WebAPI.DOMAPI.scrollIntoViewOptions,)=>unitscrollTo
letscrollTo: (WebAPI.DOMAPI.htmlMapElement,~options:WebAPI.DOMAPI.scrollToOptions=?,)=>unitscrollTo2
letscrollTo2: (WebAPI.DOMAPI.htmlMapElement, ~x:float, ~y:float)=>unitsetAttribute
Sets the value of element's first attribute whose qualified name is qualifiedName to value.Read more on MDN
letsetAttribute: (WebAPI.DOMAPI.htmlMapElement,~qualifiedName:string,~value:string,)=>unitsetAttributeNode
letsetAttributeNode: (WebAPI.DOMAPI.htmlMapElement,WebAPI.DOMAPI.attr,)=>WebAPI.DOMAPI.attrsetAttributeNodeNS
letsetAttributeNodeNS: (WebAPI.DOMAPI.htmlMapElement,WebAPI.DOMAPI.attr,)=>WebAPI.DOMAPI.attrsetAttributeNS
Sets the value of element's attribute whose namespace is namespace and local name is localName to value.Read more on MDN
letsetAttributeNS: (WebAPI.DOMAPI.element,~namespace:string,~qualifiedName:string,~value:string,)=>unitsetHTMLUnsafe
letsetHTMLUnsafe: (WebAPI.DOMAPI.htmlMapElement,string)=>unitsetPointerCapture
letsetPointerCapture: (WebAPI.DOMAPI.htmlMapElement,int)=>unitshowPopover
letshowPopover:WebAPI.DOMAPI.htmlMapElement=>unittoggleAttribute
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.Read more on MDN
lettoggleAttribute: (WebAPI.DOMAPI.htmlMapElement,~qualifiedName:string,~force:bool=?,)=>booltogglePopover
lettogglePopover: (WebAPI.DOMAPI.htmlMapElement, ~force:bool=?)=>bool