HTML DOM Dialog close() Method Last Updated : 22 Jun, 2023 Comments Improve Suggest changes Like Article Like Report The DOM Dialog close() method is used to close the dialog. The Dialog element is accessed by getElementById(). It is used in HTML5. While using this method, the user can interact with other elements on the page. It is used with the Dialog show() method. Syntax: dialogObject.close() Example: This example shows the working of Dialog close() Method: HTML <!DOCTYPE html> <html> <body> <h3> HTML DOM Dialog close() Method</h3> <p> Click on the below buttons to show or close the dialog window. </p> <button onclick="showDialog()"> Show dialog box </button> <button onclick="closeDialog()"> Close dialog box </button> <dialog id="showDialog" style="color:green"> Welcome to GeeksforGeeks </dialog> <script> let gfg = document.getElementById("showDialog"); function showDialog() { gfg.show(); } function closeDialog() { gfg.close(); } </script> </body> </html> Output: Supported Browsers: Google Chrome 37.0Opera 24.0Safari 6.0 Comment More infoAdvertise with us Next Article HTML DOM Dialog close() Method M manaschhabra2 Follow Improve Article Tags : Web Technologies HTML HTML-DOM Similar Reads HTML DOM close() Method The DOM close() method is used to close the output stream. It is used to indicate the finish of writing on a window. The close() method does not require any parameter. Syntax:document.close()Example 1: In this example, we will use DOM close() method.HTML<!DOCTYPE html> <html> <head 2 min read HTML DOM Dialog show() Method The DOM Dialog show() method is used to show the dialog. The Dialog element is accessed by getElementById(). It is used in HTML5. While using this method, the user can interact with other elements on the page. Syntax: dialogObject.show() Example: This example shows the working of Dialog show() Metho 1 min read HTML DOM Dialog showModal() Method The DOM Dialog showModal() method is used to show the dialog. The Dialog element is accessed by getElementById(). It is used in HTML5. While using this method, the user can't interact with other elements on the page. To make the user interact with other elements, use the show() Method. Syntax: dialo 1 min read HTML DOM Dialog Object The DOM Dialog Object is used to represent the HTML <dialog> element. The Dialog element is accessed by getElementById(). It is used in HTML5. Syntax: document.getElementById("ID"); Where âidâ is the ID assigned to the âDialogâ tag. Example 1: In this example, we will use DOM Dialog Object. HT 1 min read jQuery UI dialog close() Method close() method is used to disable the dialog. This method does not accept any argument Syntax: $( ".selector" ).dialog("close"); Approach: First, add jQuery UI scripts needed for your project. <link href = "https://code.jquery.com/ui/1.10.4/themes/ui-lightness/jquery-ui.css" rel = "stylesheet" 1 min read Like