Message Box
alert There are three message boxes: alert, confirm, and
prompt. Let's look at first one:
<body>
<script>
window.alert("Welcome to my site!")
</script>
</body>
You can put whatever you want inside the quotation marks.
confirm An example for confirm box:
window.confirm("Are you sure you want to quit?")
prompt Prompt box is used to allow a user to enter something
according the promotion:
window.prompt("please enter user name")
In all our examples above, we wrote the box methods as like "window.alert()".
Actually, we could simply write the instead as:
alert()
confirm()
prompt()
|