Create Alert, Confirm and Prompt boxes
by Sanju[ Edit ] 2009-12-15 13:13:22
Create Alert, Confirm and Prompt boxes
Following are the three commands involving in creating alert, confirm, and prompt boxes:
* window.alert()
* window.confirm()
* window.prompt()
Examples:
ALERT:
<script type="text/javascript">
window.alert("Welcome to HIOX")
</script>
CONFIRM:
<script type="text/javascript">
var x=window.confirm("Are you sure you are ok?")
if (x)
window.alert("Good!")
else
window.alert("Too bad")
</script>
PROMPT:
<script type="text/javascript">
var y=window.prompt("please enter your name")
window.alert(y)
</script>