Pro HTML5 and CSS3 Design Patterns

(avery) #1

CHAPTER 20 ■ ALERTS


JavaScript Alert


HTML


<h1>JavaScript Alert</h1>

<p>A JavaScript alert pops up a dialog box when the user clicks it.
Its presence can be signalled by a small image<img class="alert-image"
onclick="alert('Alert text goes here.');" src="help.gif" alt="alert" />

or specially styled text, such as a
<em class="alert" onclick="alert('Alert text goes here.');">
dotted underline.</em>
</p>

CSS


*.alert-image { cursor:pointer; margin-left:3px; }

*.alert { cursor:pointer; border-bottom:1px dotted;
font-style:normal; font-size:0.8em; }
Free download pdf