HTMLDialogElement: closedBy property
Limited availability
This feature is not Baseline because it does not work in some of the most widely-used browsers.
Experimental: This is an experimental technology
Check the Browser compatibility table carefully before using this in production.
The closedBy
property of the
HTMLDialogElement
interface indicates the types of user actions that can be used to close the associated element. It sets or returns the dialog's
closedby
attribute value.
Value
A string; possible values are:
any
-
The dialog can be dismissed with a light dismiss user action, a platform-specific user action, or a developer-specified mechanism.
closerequest
-
The dialog can be dismissed with a platform-specific user action or a developer-specified mechanism.
none
-
The dialog can only be dismissed with a developer-specified mechanism.
Examples
Basic closedBy
usage
const dialogElem = document.querySelector("dialog");
// Logs "any" to the console
console.log(dialogElem.closedBy);
Specifications
Specification |
---|
HTML # dom-dialog-closedby |