prompt(message, [default_value], [ownerWindow])
Description:
Requests user for text input in a dialog window. Returns a string as user's input or undefined when user declined to input.
Parameters:
| Name | Type | Default | Description |
|---|---|---|---|
|
|
string |
Message to user about this text input. |
|
|
|
string |
"" |
Default string that will be already present in the dialog window. |
|
|
null |
Window that will be overlaid by the dialog window. |
Returns:
Returns user provided string, or undefined if user canceled input.
Type: string | undefined
Examples:
let response = prompt("Please enter your name:", "John Doe", this);
console.log("You entered: " + response);
