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 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.