Latest Tutorials| Questions and Answers|Ask Questions?|Site Map



Home Answers Viewqa JavaScriptQuestions What is a prompt box?
Login         

View Questions and Answers by Category

Advertisements


 
Have Programming Question? Ask it here!
 
 
 


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


What is a prompt box?


Advertisement
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.

<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>


Related Tutorials/Questions & Answers:
Advertisements
Advertisements
 

 

 

DMCA.com