Create Alert, Confirm and Prompt boxes

by Sanju 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>


Tagged in:

1009
like
0
dislike
0
mail
flag

You must LOGIN to add comments