The HTML 5 <dialog> element is used to define a dialog box or a window. It may be used with form elements as well, specifying them with the attribute method="dialog". When such a form is submitted, the dialog is closed with a return value attribute set to the value of the submit button used.

Syntax:

<dialog></dialog>

Attributes:

Example

The dialog box in HTML5 example:

 

›› go to examples ››