Sunday, January 12, 2014

Window object 3) prompt()

prompt() displays a dialog box to get to input from the user.


<html>
<head>
<script type="text/javascript">
function info()
{
var m=prompt("Who are you?");
alert("I am "+m);
}
</script>
</head>
<body>
<input type="button" value="Prompt Box" onclick="info()"/>
</body>
</html>

No comments:

Post a Comment