7.2. Basic boxes and controls

7.2.1. User alert and confirm boxes

Script has a set of built-in functions that can make your life a lot easier. For example, if you want to generate a user alert box, all you have to do is to call the script function alert(). In many cases, a user alert box can provide helpful information to prevent errors and to confirm actions. An alert box is just a small window with an OK button and a warning message (see Fig. 7.3). You can create an alert box easily with the script in ex07-05.txt.

Figure 7.3. Alert box

Listing . ex07–05.txt
 1: <body> 2: <script> 3: alert("This is a user alert box! ") 4: </script> 5: </body> ...

Get Practical Web Technologies now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.