The prompt() function shows a message box that prompts the user for input.

message
message, default_value
message is an optional string to display in the message box.default_value is the optional default value to insert in the text field.An optional String value:
null if the Cancel button was pressed>
"Hello!"
> "Where do you live?"
"Saskatchewan"
prompt() function at MDN