prompt

"prompt" The Prompt function is a quick and easy way to ask the user for a value. It pops up a question modal onto the screen allowing the user to input a text value.

Format:

prompt(text, [value_on_cancel] )
 

Parameters:

Parameter Type Description
text string The text to display i.e. the question to ask the user. e.g. "What is your name?"
value_on_cancel mixed  [Optional]The value to be returned if the user clicks "cancel"

Returned Value:

Type Description
string The value that the user entered, or vsalue_on_cancel if the user clicked "cancel"

Examples

 a = prompt("name?")
 a = prompt("name?","NoName")
 

Screen Shots