Skip to main content



Rationale

Keyboard operation is required for users who are unable to use the mouse. For example, users with limited hand use may not have the fine motor control required to position the mouse pointer accurately on objects displayed on the screen. Blind users cannot position the mouse pointer because they can't see the screen. The keyboard provides a precise, discrete method of navigating and selecting. Mobility impaired users using the keyboard can precisely navigate and select using the keyboard or assistive technology that emulates the keyboard.

In addition to keyboard operation, the content affected by scripting must be accessible to assistive technology (AT), such as a screen reader, so that the AT can read the content to blind users. Otherwise, blind users will not be able to use the Web site.


Overview

Scripting, including JavaScript and the standard version ECMAScript, enables Web developers to enhance sites with dynamic content, visual effects, user interaction, and client-side processing. Scripts can update HTML content and perform visual enhancements to a Web site. Scripts can respond to many types of manual and automatic events. Some of these events include: the loading of a web page, the user selecting an item in a menu, and the submitting of a form. Due to the virtually limitless ability of scripts to affect most any content, discussing the techniques for making the use of JavaScript accessible is complex and sometimes challenging.

The general approach to making scripting accessible is:

  1. Ensure the functionality of the scripts is accessible from the keyboard (device independent).
  2. Ensure the information (content) is available to the assistive technology.

Scripts that provide both of these features are considered directly accessible. If one or both of the above cannot be achieved, then additional techniques are used to reduce the need for scripting, or to provide equivalent content that does not rely on script functionality. This checkpoint provides recommendations and techniques for accessible scripting and guidance for alternative content.


Techniques for Scripts

The following techniques and examples support Checkpoint 5 from the IBM Checklist for Web Accessibility. The minimum requirements to meet the checkpoint are identified in each section below along with recommended techniques to enhance accessibility.

In order to ensure your scripts are accessible, you must first determine whether or not your scripts are "essential" or "non-essential". If the nature of the script is only to provide enhanced visual effects and not to communicate important information, then the script is considered "non-essential". Conversely, a script that is used to perform important functionality on a site is considered an "essential" script.

If your scripts are "non-essential", refer to the link below for specific accessibility techniques:

If your scripts are considered "essential", then the scripts must be directly accessible.

For specific techniques that are required for some types of essential scripts, refer to the appropriate sub-sections below. The techniques section has been divided based upon the type of functionality a script is performing.

This checkpoint requires essential scripts to be directly accessible. If an essential script cannot be made directly accessible, then an equivalent alternative must be provided. The following technique is required for any essential script that cannot be made directly accessible:

For further techniques to improve the accessibility of essential scripts:


Testing

Test the Web site to ensure that it complies with accessibility requirements.

Tools

You will need to install the following tools to test this checkpoint:

Techniques

The following technique is required to verify this checkpoint:

Testing
  Action Result
1 View the page with a screen reader Pass:
Fail:
2 If the scripts were not directly accessible, view the page with scripts turned off in the browser to verify that an accessible alternative has been provided.

To turn off scripts in Netscape Navigator:
  1. Go to Edit - Preferences.
  2. Select Advanced, and then clear the options to enable JavaScript.
To turn off scripts in Internet Explorer 6:
  1. Go to Tools - Internet Options - Security.
  2. Select Custom Level and scroll down to the Scripting section.
  3. Select the radio button to disable Active Scripting.
Pass:
Fail:



Additional Techniques

In addition to the required tests, these techniques can be used to verify scripts are accessible.

For more information on these techniques, see Additional techniques for testing Web accessibility.

®2001, 2008 IBM Corporation

Last updated January 17, 2008.