|Property/method value type:||String primitive|
|-||myResult = prompt(aString, aDefaultValue)|
|Argument list:||aDefaultValue||An initial content for the text box|
|aString||Some text to explain what to enter|
This presents a modal dialog containing the prompting text message, a text cell to type into and two buttons, OK and Cancel.
This method is useful for debugging where you need to enter values.
Note that the text that is presented in the dialog is unformatted text and you cannot use HTML in the dialog box.
The prompt() dialog box is modal and blocking. The script must wait for a response from the user.
The value returned by the method is the text typed into the box by the user before pressing the OK button to dismiss the dialog. If the Cancel button is clicked, the method will return null instead.
Earlier documentation refers to the presence of a Clear button but this is not in evidence when testing this function on MSIE and Netscape Navigator. The Clear button is unnecessary since the text is automatically selected and typing into the box clears any previous content. Pressing the Delete key will also clear the text.