Private archive copy · Unofficial site · Content copyright belongs to Runoob Tutorial and the original authors · View Original

Window alert() method

Window alert() method

Window Object Reference Window Object


Definition and Usage

The alert() method is used to display an alert box with a specified message and a button. Confirm button alert box.

Syntax

alert(

message

)


Browser support

Internet ExplorerFirefoxOperaGoogle ChromeSafari

All major browsers support the alert() method


Example

Example

Display an alert box:

Try it »


More examples

Another popup example


Window Object Reference Window Object