<html>
<head>
<script type="text/javascript">
function disp_prompt()
{
var name=prompt("Please enter your name","Harry Potter");
if (name!=null && name!="")
{
document.write("Hello " + name + "! How are you today?");
}
}
function disp_alert()
{
alert("Hai Buy!!!");
}
onload=alert("Hai Welcome");
</script>
</head>
<body onunload="disp_alert()">
<input type="button" onclick="disp_prompt()" value="Display a prompt box" />
</body>
</html>In this code I share how to create the prompt window in alert box using JavaScript.
