Popup boxes are controls that give/take information tofrom the user. There are instances when the user should be warned about something, or there are instances where in we need some information from the user (eg: user's age, confirming submissions,etc.). In such scenarios pop up boxes are useful.
An important point to notice about popup boxes is that they are blocking. That is, they immediately capture the attention of the user, and unless attended they block the page from the user.
There are three types of Popup boxes in javascript. Each popup box is followed by a code sample. These examples are to be used under %LT;script> tags.
Alert Box:
alert('This is Alert box');
Confirm Box:
Confirm('This is Confirm box');
confirm box comes with OK and CANCEL button. OK will return true and CANCEL will return false.
Prompt Box:
Prompt('This is Prompt box','this is prompt default value');
|
No responses found. Be the first to respond and make money from revenue sharing program.
|