Best Source of Web Development Tutorials, Articles, Programming Codes, Free PHP Scripts, PHP Tutorials and Much More
Login
Username:
Password:

Popup Boxes in JavaScript

Popup Boxes

By: programmersbank

Alert Box
An alert box is often used if you want to make sure information comes through to the user.When an alert box pops up, the user will have to click "OK" to proceed.

Syntax:
alert("sometext")

Confirm Box
The Javascript confirm function is very similar to the Javascript alert function. The difference between Confirm and Alert is that Confirm Box has two choice OK or Cancel.When user will 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.

Syntax:
confirm("sometext")

Prompt Box
The JavaScript prompt box is used to gather information from the user. Prompt Boxes allows the user to enter date. 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. If the user clicks "Cancel" the box returns null.

Syntax:
prompt("sometext","defaultvalue")

Tutorial Pages

Bookmark This Page