What is a prompt box?
1 Answer(s)      6 years and 4 months ago
Posted in : JavaScript Questions

What is a prompt box?


View Answers

November 8, 2010 at 5:24 PM

The prompt() is a method of the window object, just like alert() we just saw. The format for prompt() is similar to alert(), except for one addition. Prompt uses a text field to enter a value. It also has 'OK' and 'CANCEL' buttons, while the alert has only one button.

<script language="javascript">
  var name;
  name = prompt("Pleas enter you Name"," enter you name");
  if(name != " enter you name"){
    alert("Well Come " + name + 
    " at roseindia");
    alert("Well Come at roseindia");