9.3 alert and confirm Methods

Dialog Boxes

The window object’s alert, confirm, and prompt methods generate dialog boxes. A dialog box (or dialog for short) is a window that performs one simple task. For example, this dialog simply displays a message:

With a standard window, the web programmer has quite a bit of control in terms of customization. The programmer determines the number of controls and the layout of those controls. On the other hand, dialog boxes are pretty plain, and the programmer can’t do much about that plainness. Note the plainness in the preceding dialog—there’s a message, an OK button, and a close-out X button in the ...

Get Web Programming with HTML5, CSS, and JavaScript now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.