Create a Website
HTML
Dreamweaver
CSS Tutorial
JavaScript
FREE Domain!
Any web hosting you subscribe with DotEasy will get you a FREE domain name registration.
PLUS you get:
  • FREE Website Builder
  • FREE Blog
  • FREE Forum
  • FREE Photo Album
  • FREE Email Accounts
Get your FREE domain name today!
Home > JavaScript Tutorial
SSD Web Hosting with FREE Domain

There are three kinds of popup boxes you can create using JavaScript. You've probably already seen them many times while visiting websites.

Alert Box

The JavaScriopt alert box displays a message to the user. The user will have to click "OK" to proceed.

The Code

alert("Hey, remember to tell your friends about Website-Tutorial.net!");

Confirm Box

The JavaScript confirm function is very similar to the alert function. In addition, it supplies the user with a choice, they can either click OK to confirm the popup's message or press Cancel and not agree to the popup's content.

The Code

confirm("A JavaScript Confirm asks user to make a decision (e.g. Please confirm it is OK to proceed...)");

Prompt Box

The prompt popup box let the user to enter value before to proceed. The user will have to either cilck OK or Cancel to proceed after entering an input value.

The Code

prompt("A JavaScript Prompt asks user to enter information (e.g. Please enter your first name...)","");

Enjoy this tutorial?

1. Link to this page(copy/paste into your own website or blog):
2. Add this page to your favorite social bookmarks sites:
3. Add this page as your favorites. (Press Ctrl+D)