window.HTMLDialogElement
See: https://developer.mozilla.org/en-US/docs/Web/API/HTMLDialogElement
open : boolean
Read only
isMinimized : boolean
Read only
returnValue : *
REJECTION_REASON_NOT_ALLOWED
When the promise returned from openDialog() is rejected, error.code can be equal to this value, which means that the application does not allow showing dialogs (e.g. only one dialog is allowed).
REJECTION_REASON_DETACHED
When the promise returned from openDialog() is rejected, error.code can be equal to this value, which means that the node has been detached from DOM tree.
dataset
Access to all the custom data attributes (data-*) set.
innerText : string
lang : string
Base language of an element's attribute values and text content.
See: HTMLElement - lang
dir : string
The text writing directionality of the content of the current element limited to only known values.
See: HTMLElement - dir
Since: v7.1
hidden : boolean | string
Indicates the browser should not render the contents of the element. Note: "until-found" is not supported.
See: HTMLElement - hidden, Spec - hidden attribute
nodeName : string
Read only
localName : string
Read only A string representing the local part of the qualified name of the element
See: https://developer.mozilla.org/en-US/docs/Web/API/Element/localName
tagName : string
Read only A string indicating the element's tag name
See: https://developer.mozilla.org/en-US/docs/Web/API/Element/tagName
nodeType : number
Read only
namespaceURI : string
Read only Returns the namespace URI of the element, or null if the element is not in a namespace.
See: https://developer.mozilla.org/en-US/docs/Web/API/Element/namespaceURI
id : string
Returns the property of the Element interface represents the element's identifier, reflecting the id global attribute.
See: https://developer.mozilla.org/en-US/docs/Web/API/Element/id
tabIndex : number
className : string
attributes : NamedNodeMap
Read only
style : Style
Read only
clientLeft : number
Read only
clientTop : number
Read only
clientWidth : number
Read only
clientHeight : number
Read only
offsetParent : Element
Read only
offsetLeft : number
Read only
offsetTop : number
Read only
offsetWidth : number
Read only
offsetHeight : number
Read only
scrollLeft : number
scrollTop : number
scrollWidth : number
Read only
scrollHeight : number
Read only
autofocus : boolean
Indicates if the element will focus automatically when it is loaded
uxpContainer : number
Read only
shadowRoot : ShadowRoot
Read only [ This feature is behind a feature flag. You must turn on enableSWCSupport in the featureFlags section of plugin manifest to use the same ]
Returns the open shadow root that is hosted by the element, or null if no open shadow root is present.
See: Element - shadowRoot
disabled : boolean
innerHTML
Read only
outerHTML : string
slot : string
[ This feature is behind a feature flag. You must turn on enableSWCSupport in the featureFlags section of plugin manifest to use the same ]
See: Element - slot
assignedSlot : HTMLSlotElement
Read only [ This feature is behind a feature flag. You must turn on enableSWCSupport in the featureFlags section of plugin manifest to use the same ]
contentEditable
Read only
isConnected : boolean
Read only
parentNode : Node
Read only
parentElement : Element
Read only
firstChild : Node
Read only
lastChild : Node
Read only
previousSibling : Node
Read only
nextSibling : Node
Read only
firstElementChild : Node
Read only
lastElementChild : Node
Read only
previousElementSibling : Node
Read only
nextElementSibling : Node
Read only
textContent : string
childNodes : NodeList
Read only
children : HTMLCollection
Read only
ownerDocument
Read only
show([options])
Show the non modal dialog.
object{}objectnumbernumbershowModal()
Show the modal dialog.
Returns: Promise - A promise that resolves when the dialog is closed (NSC) after calling the close() method or clicking the "submit" button. The promise will be resolved with returnValue as a parameter. The promise can be rejected if the dialog was closed for other reasons e.g. the user hit escape or closed the window, or if the application does not allow showing the dialog. The error parameter will give more details. error.code will be one of the values from HTMLDialogElement.rejectionReasons.
close([returnValue])
Closes the dialog; setting the return value (optional)
*append(...nodes)
Inserts a set of Node objects or string objects after the last child of the Element.
See: https://developer.mozilla.org/en-US/docs/Web/API/Element/append
Since: v8.0
Array<Node>prepend(...nodes)
Inserts a set of Node objects or string objects before the first child of the Element.
See: https://developer.mozilla.org/en-US/docs/Web/API/Element/prepend
Since: v8.0
Array<Node>replaceChildren(...nodes)
Replaces the existing children of a Node with a specified new set of children. These can be string or Node objects.
See: https://developer.mozilla.org/en-US/docs/Web/API/Element/replaceChildren
Since: v8.0
Array<Node>scrollTo(xOrOptions, y)
Scrolls the element to the new x and y positions. If options object is used with behavior: "smooth" then the element is smoothly scrolled.
See: https://developer.mozilla.org/en-US/docs/Web/API/Element/scrollTo
**scrollIntoView(alignToTop)
booleanscrollIntoViewIfNeeded()
attachShadow(init)
[ This feature is behind a feature flag. You must turn on enableSWCSupport in the featureFlags section of plugin manifest to use the same ]
Attaches a shadow DOM tree to the specified element and returns a reference to its ShadowRoot.
Returns: ShadowRoot
See: Element - attachShadow
focus()
blur()
getAttribute(name)
Returns: string
See: https://developer.mozilla.org/en-US/docs/Web/API/Element/getAttribute
stringsetAttribute(name, value)
See: https://developer.mozilla.org/en-US/docs/Web/API/Element/setAttribute
stringstringremoveAttribute(name)
See: https://developer.mozilla.org/en-US/docs/Web/API/Element/removeAttribute
stringhasAttribute(name)
Returns: boolean
See: https://developer.mozilla.org/en-US/docs/Web/API/Element/hasAttribute
stringhasAttributes()
Returns a boolean value indicating whether the current element has any attributes or not.
Returns: boolean
See: https://developer.mozilla.org/en-US/docs/Web/API/Element/hasAttributes
getAttributeNames()
Returns the attribute names of the element as an Array of strings
Returns: Array
See: https://developer.mozilla.org/en-US/docs/Web/API/Element/getAttributeNames
getAttributeNode(name)
Returns: *
See: https://developer.mozilla.org/en-US/docs/Web/API/Element/getAttributeNode
stringsetAttributeNode(newAttr)
See: https://developer.mozilla.org/en-US/docs/Web/API/Element/setAttributeNode
*removeAttributeNode(oldAttr)
*click()
getElementsByClassName(name)
Returns: NodeList
stringgetElementsByTagName(name)
Returns: NodeList
stringquerySelector(selector)
Returns: Element
stringquerySelectorAll(selector)
Returns: NodeList
stringsetPointerCapture(pointerId)
Sets pointer capture for the element. This implementation does not dispatch the gotpointercapture event on the element.
Throws:
DOMExceptionIf the element is not connected to the DOM.
See: Element - setPointerCapture
Since: v7.1
numberExample
// HTML
<style>
div {
width: 140px;
height: 50px;
display: flex;
align-items: center;
justify-content: center;
background: #fbe;
position: absolute;
}
</style>
<div id="slider">SLIDE ME</div>
// JS
function beginSliding(e) {
slider.setPointerCapture(e.pointerId);
slider.addEventListener("pointermove", slide);
}
function stopSliding(e) {
slider.releasePointerCapture(e.pointerId);
slider.removeEventListener("pointermove", slide);
}
function slide(e) {
slider.style.left = e.clientX;
}
const slider = document.getElementById("slider");
slider.addEventListener("pointerdown", beginSliding);
slider.addEventListener("pointerup", stopSliding);
releasePointerCapture(pointerId)
Releases pointer capture for the element. This implementation does not dispatch the lostpointercapture event on the element.
See: Element - releasePointerCapture
Since: v7.1
numberhasPointerCapture(pointerId)
Checks if the element has pointer capture for the specified pointer.
Returns: boolean - True if the element has pointer capture for the specified pointer, false otherwise.
See: Element - hasPointerCapture
Since: v7.1
numbergetBoundingClientRect()
Returns: *
closest(selectorString)
Returns: Element
See: https://developer.mozilla.org/en-US/docs/Web/API/Element/closest
stringmatches(selectorString)
Returns: boolean
See: https://developer.mozilla.org/en-US/docs/Web/API/Element/matches
stringinsertAdjacentHTML(position, value)
stringinsertAdjacentElement(position, node)
Returns: Node
**insertAdjacentText(position, text)
**hasChildNodes()
Returns: boolean
cloneNode(deep)
Returns: Node
booleanappendChild(child)
Returns: Node
NodeinsertBefore(child, before)
Returns: Node
NodeNodereplaceChild(newChild, oldChild)
Returns: Node
NodeNoderemoveChild(child)
Returns: Node
Noderemove()
before(...nodes)
Array<Node>after(...nodes)
Array<Node>replaceWith(...nodes)
Array<Node>contains(node)
NodegetRootNode(options)
Returns: Node - root node
ObjectaddEventListener(eventName, callback, options)
See: EventTarget - addEventListener
**boolean | ObjectremoveEventListener(eventName, callback, options)
See: EventTarget - removeEventListener
**boolean | ObjectdispatchEvent(event)
*