Popup Boxes in Javascript.
There are three kind of popup box is in javascript.
1)alert box.
2)confirm box.
3)prompt box.
1.Alert box.
alert box is use for the only give the msg to user for alert..
For eg:
<html>
<head><title>Alert Box</title>
<script type="text/javascript">
alert("This is alert box in javascript.");
</script>
</head>
<body>
</body>
</html>
OUTPUT:
2.Confirm box.
This is use for confirm to user.
For e.g
<html>
<head>
<title>Confirm box</title>
<script type="text/javascript">
confirm("This confirm box:");
if(!confirm)
{
alert("not confirm");
}
else
{
alert(" this is confirm..");
}
</script>
</head>
<body>
</body>
</html>
OUTPUT:
3.Prompt box
It is use for the get the value from user.
We will get the value integer as well as String from the user.
For e.g
<html>
<head><title>Alert Box</title>
<script type="text/javascript">
prompt("Enter Value:");
</script>
</head>
<body>
</body>
</html>
OUTPUT: