dialog.requestClose()
Limited availability
The requestClose()
method of a <dialog>
HTML element closes the dialog, firing a cancel
event first, which listeners can use to prevent the dialog from closing. This differs from the close()
method, which only fires the non-cancelable close
event.
Learning resources on MDN
Browser support
- Chrome 134 Released on 2025-03-04
- Chrome Android 134 Released on 2025-03-04
- Edge 134 Released on 2025-03-06
- Firefox ❌
- Firefox for Android ❌
- Safari ❌
- Safari on iOS ❌
Specifications
- HTML (#dom-dialog-requestclose), from HTML Workstream (WHATWG).
View web-platform-tests results for this feature - View the feature source file (dist) - Edit the feature - Report an issue about this feature