Controlling a dialog programmatically
The dialog requires few methods in order to function. The full list of the methods we can call on a dialog is as follows:
| 
 Method  | 
 Used to  | 
|---|---|
| 
 
  | 
 Close or hide the dialog.  | 
| 
 
  | 
 Permanently disable the dialog. The   | 
| 
 
  | 
 Temporarily disable the dialog.  | 
| 
 
  | 
 Enable the dialog if it has been disabled.  | 
| 
 
  | 
 Determine whether a dialog is open or not.  | 
| 
 
  | 
 Move the specified dialog to the top of the stack.  | 
| 
 
  | 
 Open the dialog.  | 
| 
 
  | 
 Get or set any configurable option after the dialog has been initialized.  | 
Toggling the dialog
We first take a look at opening the widget, which can be achieved with the simple use of the open method. Let's revisit dialog3.html in which the autoOpen option was set to false, so...