You can easily create Popup Boxes using JavaScript. Many developers and designers use them to interact with the user in three different ways:
Alert Box
Prompt Box
Confirm Box
Before starting with the above shown Popup Boxes, run some programs in JavaScript using the following links:
Alert Box
It can be displayed using alert() function. In this user have to click "OK" to proceed.
Syntax: window.alert("message");
Example: alert("This is an alert box");
Alert Box |
Prompt Box
It is used to get data from user. It has a "OK" and "Cancel Button". Can be displayed using prompt() function.
Syntax: window.prompt("message","the DefaultText");
Example: prompt("Enter your website name","website");
Prompt Box |
Confirm Box
This box is used to Verify and Accept something which means to let users make any choice. It can be displayed using confirm() function.
Syntax: window.confirm("message");
Example: confirm("This is techterabyte.com, Click Ok or Cancel!");
Confirm Box |
Note: Running the above on Linux Ubuntu 13.10, so the GUI may differ in other Operating Systems.
No comments:
Post a Comment