Nearby lessons

24 of 40

📢 JavaScript alert()

📌 What is JavaScript alert()?

The alert() method displays a message box with an OK button.

Used to show important information or warnings to the user.

📋 alert() Basics

AttributeDescription
Syntaxalert(message)
Returnundefined
Use CaseSimple notifications
Code Example
PREVIEW READY
Loading Editor...
Live Preview

🧠 Test Your Knowledge

2 Questions

Progress: 0 / 2
Keep Going!JS - Confirm Boxes