The confirm dialog is a simple yes or no dialog and can be used to 'confirm' that a user wishes to proceed.
window.confirm("Do you wish to continue?");
If user input needs to be more than an OK or Cancel, the prompt dialog can be used. A prompt dialog provides the user with a textbox that allows them to input a response to the dialog:
window.alert(window.prompt("What is your name?"));
The prompt may optionally provide a placeholder:
window.alert(window.prompt("What is your name?", "Jamie Balfour"));
As with the
alert method, both
prompt are methods provided by the
window and do not
window. in front of them.