What is a prompt box?
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.
<html> <body> <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"); }else{ alert("Well Come at roseindia"); } </script> </body> </html>
Ads