Nearby lessons
25 of 40✅ JavaScript confirm()
📌 What is JavaScript confirm()?
The confirm() method shows a dialog box with OK and Cancel buttons.
Used to ask user confirmation before performing an action.
📋 confirm() Basics
| Attribute | Description |
|---|---|
Syntax | confirm(message) |
Return | true (if OK) / false (if Cancel) |
Use Case | Delete confirmation, exit prompt |
Code Example
PREVIEW READY
🧠 Test Your Knowledge
2 QuestionsProgress: 0 / 2
Keep Going!JS - Prompt Boxes