JavaScript Alert Test Page

This page demonstrates three types of JavaScript alert box.

Alert Box

The Alert Box is used for information, it contains a message and a single [OK] button to dismiss the alert.

Confirm Box

The Confirm Box allows more complex interaction.

In addition to [OK], there is a [Cancel] button.

Prompt Box

The Prompt Box additionally allows the input of text. This text is only returned to the application if the user clicks [OK].

DOM Interaction

For each of alert types, the action taken by the user will be displayed on the page.

Additionally an attribute on the trigger buttons will count the number of times the dialog has been displayed.

Help keep this site free by joining our Patreon Membership site. Membership costs as little as $1 a month and includes access to exclusive e-books and online training courses.