ISMA309


Message Boxes

by Haig. Average Reading Time: less than a minute.

Message Boxes

There are three message boxes: alert, confirm, and prompt.

Alert

Let’s look at the 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 window.alert(). Actually, we could simply write the following instead as:

	alert()
	confirm()
	prompt()

No comments on ‘Message Boxes’

Leave a Reply