You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add close button in htmldialogelement/show/index.md example (#42053)
* Add close / cancel button
Example was missing cancel button.
Added a close button matching the /en-US/docs/Web/API/HTMLDialogElement/close example
* Update index.md
* Update index.md
* Update to current api conventions with live exmaple
---------
Co-authored-by: Hamish Willee <[email protected]>
The **`show()`** method of the {{domxref("HTMLDialogElement")}}
12
-
interface displays the dialog modelessly, i.e., still allowing interaction with content
13
-
outside of the dialog.
11
+
The **`show()`** method of the {{domxref("HTMLDialogElement")}} interface displays the dialog modelessly, i.e., still allowing interaction with content outside of the dialog.
The following example shows a simple button that, when clicked, opens a
37
-
{{htmlelement("dialog")}} containing a form via the `show()` method. From
38
-
there you can click the _Cancel_ button to close the dialog (via the
39
-
{{domxref("HTMLDialogElement.close()")}} method), or submit the form via the submit
40
-
button.
34
+
### Basic usage
35
+
36
+
The following example shows a simple button that, when clicked, opens a {{htmlelement("dialog")}} containing a form via the `show()` method.
37
+
From there you can click the _Cancel_ button ("X") to close the dialog (via the {{domxref("HTMLDialogElement.close()")}} method), or submit the form via the submit button.
38
+
39
+
#### HTML
41
40
42
41
```html
43
42
<!-- Simple pop-up dialog box, containing a form -->
0 commit comments