Welcome to Bucaro TecHelp!

Bucaro TecHelp
Maintain Your Computer and Use it More Effectively
to Design a Web Site and Make Money on the Web

About Bucaro TecHelp About BTH User Agreement User Agreement Privacy Policy Privacy Site Map Site Map Contact Bucaro TecHelp Contact RSS News Feeds News Feeds

Holiday Gift Guide
Holiday Gift Guide

Java Script alert Message Box

In Java Script programming, there are many occasions when you need to display a short message to the user, or request a bit of information from the user. In these instances, you can use a message box.

Java Script provides three types of message boxes, the alert, confirm, and prompt. They are all easy to create and use.

These message boxes are "modal" dialog boxes, meaning that program flow halts while the message box is visible. The user is unable to use the page that spawned the message box until they click on a button to close the message box. This may be disruptive to the user. You can also design your own custom message box, which you may or may not choose to make modal.

Alert message box

The alert message box presents a message with a single [OK] button to dismiss the message box. Example code to create an alert message box is shown below.


Instead of a text string for the message, you could use a variable name. The alert function will automatically convert the value in the variable for display, making the alert a handy tool for script debugging.

More Java Script Code:
• The switch / case Structure
• Comparison Operators
• The continue Statement
• Determine Absolute Value
• Define Lines in a String
• Access Web Page Elements With getElementById
• Extract Part of a String
• Java Script Strings
• Accessing Web Page Elements
• Java Script Character Encoding and Decoding

RSS Feed RSS Feed

Follow Stephen Bucaro Follow @Stephen Bucaro

Fire HD
[Site User Agreement] [Privacy Policy] [Site map] [Search This Site] [Contact Form]
Copyright©2001-2017 Bucaro TecHelp 13771 N Fountain Hills Blvd Suite 114-248 Fountain Hills, AZ 85268