prompt method
Displays a modal dialog box with the specified message prompt, a text input field, and OK and Cancel buttons.
prompt(prompt [, value [, title]] )
Parameters
String prompt
Specifies the message to display in the dialog box
String value
[optional] Specifies the initial value displayed in the text input field.
String title
[optional] Specifies the dialog box title. If omitted, the title defaults to "Prompt".
Returns
String. Returns the string in the text input field if the user clicks OK. Returns null if the user clicks Cancel.
这对您有帮助吗?