January 2018
Intermediate to advanced
678 pages
20h 16m
English
prompt MethodAs mentioned earlier, the window object has three methods that generate dialog boxes—alert, confirm, and prompt. We’ve already described alert and confirm; now it’s time for prompt.
The prompt method generates a dialog box that displays a specified question. The user is expected to answer the question by entering a value in a text control and then clicking OK. Or, the user may click Cancel to avoid answering the question. Here’s an example dialog generated by a prompt method call:
Here’s the syntax for a prompt method call:
prompt(prompt-message, "");
What follows is an example prompt method call that uses this syntax and ...
Read now
Unlock full access