Access Key - Specifying Access Keys

Specifying Access Keys

Access keys are specified in HTML using the accesskey attribute. The value of an element’s accesskey attribute is the key the user will press (typically in combination with one or more other keys, as defined by the browser) in order to activate or focus that element. Though the accesskey attribute sets the key that can be pressed it does not automatically notify the user of the bound access key. One convention is for the page author to show the access key value by using the tag to underline the a letter in the link’s text corresponding to the accesskey assigned. For the link below a user would press Alt+H on Internet Explorer, Ctrl+H on a Mac (the command key can give undesired results) and ⇧ Shift+Esc+H on Opera to be directed to index.html.

Home

or to emphasize ‹H›:

Home

alternatively, the following CSS can be used to indicate the character:

*:after {content:' '}

Emphasize isn’t necessary, but can be useful to the user. It helps them identify which key to press to navigate to where they want to. Another possible way of displaying which accesskeys do what is to create a page with all the accesskeys displayed. Or the webmaster could do both. Another option for the end user is to install a user script such as FireFox Access Bar for GreaseMonkey.

Read more about this topic:  Access Key

Famous quotes containing the words access and/or keys:

    The professional celebrity, male and female, is the crowning result of the star system of a society that makes a fetish of competition. In America, this system is carried to the point where a man who can knock a small white ball into a series of holes in the ground with more efficiency than anyone else thereby gains social access to the President of the United States.
    C. Wright Mills (1916–1962)

    Bless all useful objects,
    the spoons made of bone,
    the mattress I cook my dreams upon,
    the typewriter that is my church
    with an altar of keys always waiting.
    Anne Sexton (1928–1974)