How to provide additional keyboard access to your web pages.
Accesskey is an attribute that can be added to an element (e.g. a form field) so that a user can jump to that element by using a keyboard command; pressing the appropriate combination of keys, 'gives focus' to the associated element, e.g., if used in a form, the cursor jumps to the form input field.
Here is an example of adding the accesskey attribute to the label of a form field (as the label is associated with an input element, the input element gets focus, i.e the curser jumps to that form field):
<label for="name" accesskey="1">Name (accesskey 1):</label><br />
<input type = "text" name = "membername" id="name" />
The accesskey attribute can be added to the following elements: a, input, textarea, button, label, area, label, and legend. The behaviour of the accesskey attribute depends on the type of element it is assigned to, e.g., on a form field it give 'focus' to the field, but for links it means the user jumps to the page being link to.
The keys that a user needs to press will depend on the operating system and browser being used; in general the accesskey can be invoked on the windows platform by pressing the 'Alt key' and the access key character, and on the Mac by pressing the 'Ctrl key' and the accesskey character.
There are problems with accesskey you should be aware of; one problem is 'how will the user know what keyboard shortcuts to use for the various elements on the webpage?'. The UK government, makes an attempt to get around this problem by publishing a list of recommended accesskey presses: http://www.e-envoy.gov.uk/oee/oee.nsf/sections/webguidelines-content/$file/04.htm#4
Visit the 'WATS.ca' site at http://wats.ca/resources/accesskeys/19 for further information, and a discussion on the possible 'down side' of using the accesskey attribute.
---You have permission to reprint this and other accessible web design tips on your own website - see http://www.mcu.org.uk/weeklytips/ for terms and conditions.