Accessible JavaScript Summary
JavaScript Event Handlers
There are two types of JavaScript event handlers - device dependent and device independent. When implementing event handlers, you must either use a device independent event handler or use multiple device dependent event handlers to accommodate all users. Below is a list of common event handlers and their associated accessibility issues.
onMouseOverandonMouseOut- Device dependent (require the use of a mouse)
- Ensure important content or functionality is not introduced with these event handlers
- Use in conjunction with the onFocus and onBlur event handlers to allow keyboard accessibility
- Provide an accessible alternative if the content or functionality cannot be made natively accessible
onFocusandonBlur- Device independent (work with both keyboard and mouse)
- Test to ensure that accessibility is not affected
onClickandonDblClick- Device dependent (require the use of a mouse)
- onClick is activated by keyboard input when used with links and form elements
- There are no device independent or keyboard accessible equivalents to these event handlers
- Functionality and content provide by the onClick event handler must also be made accessible
onChangeandonSelect- Device independent (work with both keyboard and mouse)
- Functionality and content provide by the onChange and onSelect event handlers must also be made accessible
- Drop-down menu navigation items that are triggered with onChange are not fully keyboard accessible
wet Working Examples
Accessibility Responsibility Breakdown (WCAG 2.0)
- Accessibility Responsibility Breakdown (WCAG 2.0) - English example
- Accessibility Responsibility Breakdown (WCAG 2.0) - French example
- Accessibility Responsibility Breakdown (WCAG 2.0) - English example - Planning accessibility
- Accessibility Responsibility Breakdown (WCAG 2.0) - French example - Planning accessibility
Archived Web page template
Auto-complete for text input fields (datalist polyfill)
Base theme (v3.1 Beta)
Calendar interface
Charts and graphs support
CLF 2.0 theme
CSS Grid System
Design guide (v3.1 Beta)
Drupal variant
Expandable/collapsible content (details/summary polyfill)
- Expandable/collapsible content (details/summary polyfill) - English example
- Expandable/collapsible content (details/summary polyfill) - French example
- Expandable/collapsible content (details/summary polyfill) - English example - Expand/Collapse All Content (v3.1 Beta)
- Expandable/collapsible content (details/summary polyfill) - French example - Expand/Collapse All Content (v3.1 Beta)