Message Boxes

Message Boxes

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

Alert

Let’s look at the first one:

		
			
		

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()

Posted

in

,

by

Tags:

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *