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
Example02
Code Cell
Loading Editor...
✏️ You can edit this code — click Run to refresh the preview.
Output

🧠 Test Your Knowledge

2 Questions
Progress: 0 / 2