Curriculum
Course: JavaScript Basic
Login

Curriculum

JavaScript Basic

JSHome

0/216
Text lesson

JS Popup Alert

JavaScript offers three types of popup boxes: Alert box, Confirm box, and Prompt box.

Alert Box

An alert box is commonly used to ensure that important information is communicated to the user.

When an alert box appears, the user must click “OK” to continue.

Syntax

window.alert(“sometext“);

The alert() method can be used without the window prefix.

Example

alert(“I am an alert box!”);