Web platform features explorer

dialog.requestClose()

Limited availability
Tags: api Groups: HTML > HTML elements

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

Specifications