0% found this document useful (0 votes)
44 views7 pages

03 Dialog Boxes

The document discusses different types of dialog boxes in JavaScript including alert(), prompt(), and confirm(). Alert boxes display a message and an OK button. Prompt boxes ask the user a question and accept a text input. Confirm boxes ask a yes/no question and return a boolean value depending on which button is clicked. These dialog box methods allow windows to interact with and get input from the user.

Uploaded by

Hermie Coso
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
44 views7 pages

03 Dialog Boxes

The document discusses different types of dialog boxes in JavaScript including alert(), prompt(), and confirm(). Alert boxes display a message and an OK button. Prompt boxes ask the user a question and accept a text input. Confirm boxes ask a yes/no question and return a boolean value depending on which button is clicked. These dialog box methods allow windows to interact with and get input from the user.

Uploaded by

Hermie Coso
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 7

Dialog Boxes

• The document object is defined within a


window.
• The window is an object and has its own
methods.
• window object uses dialog boxes to interact with the
user.
• The dialog boxes are created with three methods:
• alert()
• prompt()
• confirm()
•The window’s alert() method is used to
send a warning or alert to the user to do
something.

•The alert() method creates a little


independent window—called a dialog
box—that contains a user-customized
message placed after a small triangle, and
beneath it, an OK button.
• prompt() method
• asks the user for some small amount of information
such as a password, completion of a form input, or
personal information, such as nickname or title.
• The confirm dialog box is used to confirm a user’s
answer to a question.
• A question mark will appear in the box with an OK
button and a Cancel button.

• If the user clicks the OK button, true is returned;


• If the Cancel button, false is returned.

• This method takes only one argument, the question you


will ask the user.
END of DISCUSSION

You might also like