Accordion
Javascript widgets often pose additional difficulties for people who rely on assistive technology. It is important to make sure that:
- widgets can be accessed and controlled using a keyboard, and
- users are properly notified of any content changes on a page.
Bad Example
In the following example a Javascript accordion widget cannot be controlled by a keyboard. Moreover, screen readers will not be able to determine the number of available panels, or their current state.
Good Example
In the following example the accordion can be easily accessed with a keyboard. Screen readers will announce the number of tabs, wether multiple tab panels can be visible at the same time, and the state of a currently selected tab.