Using alert(), prompt(), and confirm() in Javascript


Interact with users using simple dialog boxes.

Source Code

alert('Hello, World!'); // Shows a message
let age = prompt('How old are you?', 100); // Asks for input
let isAdult = confirm('Are you an adult?'); // Yes or no
Subscribe
Notify of
guest
0 Comments
Inline Feedbacks
View all comments