Working with Promt in Javascript

vishalneeraj-24503
Posted by vishalneeraj-24503 under JavaScript category on | Points: 40 | Views : 763
Like Console application in Dot net,we can use the same thing with the help of Prompt in Javascript.Prompt means asking a user to enter something in the input box.

We can understand it by an example:-
Make a Javascript function as below:-

<script type="text/javascript">
function prompt_alert()
{
var value = "";

var name = prompt("Please enter your name", "Vishal");

if (name != null)
{
value = name;
alert(value);
}
}
</script>


So,it's easy to understand about Prompt.

Comments or Responses

Login to post response