Tutorials from WAC. Click or press ALT+T to return to the Tutorials main page.

Understanding and Applying
Section 508 Standards


divider

Using Scripts:

(l) When pages utilize scripting languages to display content, or to create interface elements, the information provided by the script shall be identified with functional text that can be read by assistive technology.

Javascript is one of the most popular scripting languages for web development. In addition to libraries of Javascript code available online, two of the most popular web development tools, FrontPage and Dreamweaver, include easy-to-access code snippets that add little "extras" to web pages. Developers should use caution when deciding to include Javascript or other scripting elements on their pages. Here are a few of the most popular uses for Javascript and some of the accessibility issues to consider:

  • onClick – The onClick event handler is triggered when the user clicks once on a particular item. It is commonly used on links and button elements and, used in connection with these elements, it works well with screen readers. If clicking on the element associated with the onClick event handler triggers a function or performs some other action, developers should ensure that the context makes that fact clear to all users. Do not use the onClick event handlers for form elements that include several options (e.g. select lists, radio buttons, checkboxes) unless absolutely necessary.
  • onMouseOver and onMouseOut – These two event handlers are very popular on many web sites. For instance, so-called rollover gif's, which swap images on a web page when the mouse passes over an image, typically use both of these event handlers. These event handlers neither can be accessed by the mouse nor interfere with accessibility – a screen reader simply bypasses them entirely. Accordingly, web designers who use these event handlers should be careful to duplicate the information (if any) provided by these event handlers through other means.
  • onChange – This event handler is very commonly used for triggering JavaScript functions based on a selection from within a <select> tag. Surprisingly, it presents tremendous accessibility problems for many commonly used screen readers and should be avoided. Instead, web developers should use the onClick event handler (associated with a link or button that is adjacent to a <select> tag) to accomplish the same functions.

For more information on accessibility issues when using Javascript, see:

See also: Using Time Out Scripts in this tutorial.

Next  Link and graphic of hand pointing to the next page.

divider

(a) Alternate Descriptions for Non-Text Elements | (b) Synchronization with Multimedia | (c) Use Color for Design, not Context | (d) Using Style Sheets | (e) Server-Side Image Maps | (f) Client-side Image Maps | (g & h) Data Table Headers | (i) Using Frames | (j) Flashing or Flickering Elements | (k) Updating Text-Only Versions | (l) Using Scripts to Create Dynamic Pages | (m) Using Applets and Plug-Ins | (n) Using Online Forms | (o) Skip Navigation Link | (p) Using Time Out Scripts | 508 Checklist | Testing for 508 Compliance |

Return to Start of Section 508 Tutorial

Information in this tutorial adapted from the Section 508 web site: http://www.section508.gov and the Access Board's Guide to the Section 508 Standards for Electronic and Information Technology.