From d2cb71d04b6ba4b22d8de4b22009f794d71194f5 Mon Sep 17 00:00:00 2001 From: Freeda Vales Date: Sun, 2 Dec 2018 03:48:48 +0530 Subject: [PATCH] Added dialog tag guide in HTML section (#23173) --- .../english/html/elements/dialog-tag/index.md | 39 +++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 guide/english/html/elements/dialog-tag/index.md diff --git a/guide/english/html/elements/dialog-tag/index.md b/guide/english/html/elements/dialog-tag/index.md new file mode 100644 index 0000000000..1491a8bb07 --- /dev/null +++ b/guide/english/html/elements/dialog-tag/index.md @@ -0,0 +1,39 @@ +--- +title: Dialog Tag +--- +## Dialog Tag +The `` tag defines a dialog box or window. + +The `` element makes it easy to create popup dialogs and modals on a web page. + +The `` tag is new in HTML5. + +#### Attributes: +open: +Indicates that the dialog is active and that the user can interact with it. +When the open attribute is not set, the dialog shouldn't be shown to the user. + +#### Example: + +```html + +

This is an open dialog window

+
+``` + +#### HTML DOM Dialog Object + +#### To access a element by using getElementById(): + + `var dialog = document.getElementById("myDialog");` + +#### Create a Dialog Object: + `var x = document.createElement("DIALOG");` + +#### Dialog Object Methods: +close() - Closes the dialog
+show() - Shows the dialog
+showModal() - Shows the dialog and makes it the top-most modal dialog + +#### Further reading: +[MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/dialog)