Javascript prompt box

Here is a simple javascript for a prompt box


<html>
<head>
<script type=”text/javascript”>
function disp()
{
var name=prompt(”Please enter your name”);
if (name==”ramanean”&&name=”Ramanean”)
{
document.write(”Hello ” + name + “Are you fine?”);
}
}
</script>
</head>
<body>

<input type=”button” onclick=”disp” value=”Display a prompt box” />

</body>
</html>


The above code will display a prompt box “Hello Ramanean Are you fine?” when display prompt box is clicked

This entry was posted on Friday, February 29th, 2008 at 12:13 am and is filed under Javascripts. You can follow any responses to this entry through the RSS 2.0 feed. You can leave a response, or trackback from your own site.

1 Comment

  1. John says:

    alert (’thanks for your notes.’)

    ... on July August 15th, 2009

Post a Comment