1. Home
  2. Computing & Technology
  3. JavaScript

Prompt

By Stephen Chapman, About.com

Definition: The prompt function that is predefined for use in Javascript is similar to the alert and confirm functions in that it will display a popup message on the screen. The difference with prompt is that this [popup actually has an input field where your visitor can type in a value to be returned to your script. This is not a reserved word so you can declare your own variable or function called prompt but if you do then you will not be able to use the built-in function.
Examples:
password=prompt('Please enter your password:','');
Explore JavaScript
About.com Special Features

Stay connected and entertained with reviews on tips on the latest HDTVs, cellphones and more. More >

Easy ways to connect two computers for networking purposes. More >

  1. Home
  2. Computing & Technology
  3. JavaScript

©2009 About.com, a part of The New York Times Company.

All rights reserved.