JavaScript offers three types of popup boxes: Alert box, Confirm box, and Prompt 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.
window.alert(“sometext“); |
The alert()
method can be used without the window
prefix.
alert(“I am an alert box!”); |