|
|
Create Alert, Confirm and Prompt boxes - Javascript
|
Views : 336
|
|
Tagged in : Javascript
|
|
|
Report This Scrap as Inappropriate We request you to choose the appropriate categroy and subcategory that suits your
objectionable concern about the scrap, So that our team can review and find out whether it violates our Guidelines or the
scrap is not suitable for all viewers.
|
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>
|
|
By Sanju, On - 2009-12-15 |
|
|
|