JavaScript Reference/Javascript Methods/prompt
"prompt()" Example
<source lang="javascript">
<html> <body> <script language="JavaScript"> function function1() {
window.prompt("Please, enter your full name", "Yes, here");
} </script> <input type="button" value="Open a prompt window" onclick="function1();"> </body> </html>
</source>
"prompt()" is applied to
<source lang="javascript">
+----------------+--------------------------------------------------------------+ | Applied_To |window | +----------------+--------------------------------------------------------------+
</source>
"prompt()" Syntax, Parameters and Note
<source lang="javascript">
Note: Opens a prompt window. Returns the string typed in by the user.
Syntax:
window.prompt(param1, param2) Parameters:
param1 Optional; the message to display in the prompt window. param2 Optional; a default value for the input field. </source>