Events

Events are at the heart of interactive web pages. They trigger behaviors based on your visitors’ actions, like clicking a link, mousing over an image, or simply loading the page. But not all events work with all tags. For example, the onLoad event only works with Web pages and images, not paragraphs, divs, or any other page element. The Event menu in the Behaviors panel can help: It lists only those events available for the tag you’re targeting.

Current browsers—Firefox, Safari, Google Chrome, and Internet Explorer 8—support a wide range of events for many HTML tags. In most cases, you’ll find that many of the events listed in the following pages work with all of the tags pictured in Figure 14-3. Many events work with other tags as well, such as headline, paragraph, and div tags. However, don’t go crazy. Making an alert message appear when someone double-clicks a paragraph is more likely to win your site the Hard-To-Use Website of the Month award than a loyal group of visitors.

To help you select a good combination of event and HTML tags, the following pages list and explain the most common and useful HTML tags and events.

Each section shows you the name of the event as you’ll see it listed in the Behaviors panel, a plain-English description of what that event really means, and the list of tags to which this event is most commonly applied. See Figure 14-3 for the visual representations of those HTML tags. For example, you’ll see that the <select> tag represents a pull-down menu. ...

Get Dreamweaver CS5: The Missing Manual now with O’Reilly online learning.

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