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 theSection 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:
Access key | Target |
---|---|
S | Skip navigation |
1 | Home page |
2 | What’s new |
3 | Site map |
4 | Search |
5 | FAQs |
6 | Help |
7 | Complaints procedure |
8 | Terms and conditions |
9 | Feedback form |
0 | Access key details |
WebAIM provides similar shortcuts:
Access key | Target |
---|---|
1 | Home page |
2 | Skip navigation |
3 | Printer-friendly version |
4 | Search |
These almost match with the access keys used by Mark Pilgrim (accessibility evangelist):
Access key | Target |
---|---|
1 | Home page |
2 | Skip navigation |
4 | Search |
0 | Access key details |
And finally, the accessibility magazine Made For All uses a few different shortcuts:
Access key | Target |
---|---|
1 | Home page |
2 | News |
3 | Previous issues |
4 | Resources |
5 | About |
0 | Access 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:
Shortcut | Web Site |
---|---|
2 | Dive Into Mark |
2 | Zeldman |
2 | WebAIM |
9 | Cinnamon Interactive |
C | Clagnut |
C | Accessify |
S | UK 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.