Accesskey standards

§ Web standards · Accessibility

One of my goals for Clagnut is to make it accessible beyond good alt tags and valid code. It currently passes WCAG 1.0 Priority 1 and Section 508. To achieve this, a skip navigation link (skip nav) is required. To make skip nav (and other essential navigation) more effective, we should provide keyboard shortcuts through the accesskey attribute. For example:

<a href="#content" accesskey="2">skip nav</a>

This allows visitors to press ALT+2 or CTRL+2 (on Windows and Macs respectively) to move focus straight to the anchor in question. Keyboard shortcuts can also be applied to form controls by adding accesskey attributes to input tags in the same way.

It’s also helpful to add keyboard shortcuts for other important parts of the site, such as search, help, home page and the page which lists the keyboard shortcuts. It struck me that there should be consistency in access keys across the Web. I couldn’t find any mention of standards or suggestions on the Section 508 or WAI sites, so I attempted to see if a de facto standard has been adopted none-the-less.

The UK Government provides accessibility guidelines to which all its websites should comply. These guidelines state:

UK Government Shortcuts
Access keyTarget
SSkip navigation
1Home page
2What’s new
3Site map
7Complaints procedure
8Terms and conditions
9Feedback form
0Access key details

WebAIM provides similar shortcuts:

WebAIM Shortcuts
Access keyTarget
1Home page
2Skip navigation
3Printer-friendly version

These almost match with the access keys used by Mark Pilgrim (accessibility evangelist):

Dive Into Mark Shortcuts
Access keyTarget
1Home page
2Skip navigation
0Access key details

And finally, the accessibility magazine Made For All uses a few different shortcuts:

Made For All Shortcuts
Access keyTarget
1Home page
3Previous issues
0Access key details

So there’s a fair bit of overlap between sites. The use of numbers is sensible as software often uses letters for its own shortcuts, particularly for access to the command menu. Letters also make more sense when dealing with forms (think shortcuts in dialog boxes). So the main bone of contention appears to be skip nav. Here’s a few samples:

Skip Nav Shortcuts Across the Web
ShortcutWeb Site
2Dive Into Mark
9Cinnamon Interactive
SUK Government

The consensus of opinion from this little lot is ‘2’. I’ve made the change accordingly and added more keyboard shortcuts to other parts of the site – see the new accessibility statement. I’ve also made my DHTML site contents menu a bit more keyboard friendly by adding an onfocus event handler to display it.