Example for Checkpoint
6.4 - For scripts and applets, ensure that event handlers are input device-independent.

Example
Slide 57 of 120
Previous slide. Next slide.

Priority 2

To ensure people get the equivalent message on systems that don't support scripts and event-handlers, include some equivalent content in the <NOSCRIPT> element. As well ensure that the event-handlers you use are logical rather than device-dependent (See Checkpoint 9.3 for more about using event-handlers accessibly.)

The following example displays a BUTTON. The button is associated with a JavaScript SCRIPT. When the script is triggered by an EVENT, an ALERT window pops up on the screen of a graphical browser. The alert window contains a message for the user. In this case, the event is either the TAB key moving the focus to the button, or the user passing the mouse cursor over the button. The 'OnFocus' EVENT-HANDLER looks for the first type of event, while the 'OnMouseOver' event-handler looks for the second.

The script is followed by the NOSCRIPT element that contains the same message that would have appeared in the alert window. If BUTTON and SCRIPT (or the particular script-language) are not supported, a browser should display the content of BUTTON and the NOSCRIPT elements. In that case, you should see:

Win a prize!
You Win First Prize!

To see the markup for this example, please follow this link.

Up one level To Checkpoints for Guideline 6.
Next slide: Example for Checkpoint 6.5

Introduction: Overview Guidelines: Overview Checkpoints: Overview Examples: Overview

Previous page. Next page.

Chuck Letourneau & Geoff Freed

W3C Web Accessibility Initiative

Copyright © 2000 W3C