0% found this document useful (0 votes)
7 views

Message Boxes in JavaScript - Alert, Confirm and Prompt

The document discusses different types of popup boxes in JavaScript including alert boxes, confirm boxes, and prompt boxes. It provides examples of how each box is used and what they return depending on user input.
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
7 views

Message Boxes in JavaScript - Alert, Confirm and Prompt

The document discusses different types of popup boxes in JavaScript including alert boxes, confirm boxes, and prompt boxes. It provides examples of how each box is used and what they return depending on user input.
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 8

Message Boxes in

JavaScript – Alert,
Confirm and Prompt
Computer Science
Alert Box in JavaScript

An alert box is one type of popup


boxes in JavaScript which is often used
to make sure that information have
come through the user. So, the user will
have to click “OK” to proceed when an
alert box pops up on the window.
Program and Output of Alert Box

Program of Alert Box Output of Alert Box


Confirm Box in JavaScript

A confirm box is often used if you want


the user to verify or accept something.
When a confirm box pops up, the user
will have to click either "OK" or "Cancel"
to proceed. If the user clicks "OK", the
box returns true. If the user clicks
"Cancel", the box returns false.
Program and Output of Confirm Box

Program of Confirm Box Output of Confirm Box


Prompt Box in JavaScript

A prompt box is often used if you want


the user to input a value before entering a
page. When a prompt box pops up, the
user will have to click either "OK" or
"Cancel" to proceed after entering an
input value. If the user clicks "OK" the box
returns the input value.
Program and Output of Prompt Box

Program of Prompt Box Output of Prompt Box


Thank you
Prepared by : Sreelakshmi SR | 6C

You might also like