Popbox script:
Alert Box:
Code:
<html>
<head>
<script type="text/javascript">
function alertexample()
{
alert("Got the message");
}
</script>
</head>
<body>
<input type="button" onclick="alertexample()" value="Show alert box" />
</body>
</html>
Confirm Box:
Code:
<html>
<head>
<script type="text/javascript">
function confirmexample()
{
var check=confirm("Press ");
if (check==true)
{
document.write("Ok pressed!");
}
else
{
document.write("Cancel pressed ");
}
}
</script>
</head>
<body>
<input type="button" onclick="confirmexample()" value="Show confirm box" />
</body>
</html>
Prompt Box:
Code:
<html>
<head>
<script type="text/javascript">
function promptexample()
{
var msg=prompt("Message");
if (msg!=null && msg!="")
{
document.write("Got message");
}
}
</script>
</head>
<body>
<input type="button" onclick="promptexample()" value="Show prompt box" />
</body>
</html>
Bookmarks