1) Alert dialog box:
- to see a message before doing anything on the website.
- to warn the user abut something.
- It can be used as an error indication.
- To confirm some action.
2) Prompt dialog box:
The prompt dialog box is very useful when a pop-up text box to used to get user input. Thus it enables to interact with the user. The user needs to fill in the field and then click OK.
this dialog box is displayed using a method called prompt() which takes two parameters.
This dialog box with two buttons: OK and Cancel. If the user clicks on Ok button the window method prompt() will return entered value from the text box. If the user clicks on the Cancel button the window method prompt() returns null.
3) Confirmation dialog box:
A confirmation dialog box is mostly used to take user's consent's on any option. It displays a dialog box with two buttons:OK and Cancel. If the user clicks on OK button the window method confirm() will return true. If the user clicks on the Cancel button confirm() returns false.