You are here: Reference > HTML > attributes > accessKey

accessKey attribute

Browser support:
Sets an access key to an element.
The accessKey attribute is useful if you want to give the user an opportunity to set focus to an element using a keyboard shortcut. Activating an access key induces additional action for some controls, e.g. in case of button, input:button, input:checkbox and input:radio elements it simulates a mouse click, so it toggles the CHECKED state of input:checkbox and input:radio elements.
Access keys can be activated differently in different browsers:
Internet Explorer: ALT + accesskey
Firefox: SHIFT + ALT + accesskey
Google Chrome: ALT + accesskey.
Safari: ALT + accesskey. On the Mac platform, use the CTRL + accesskey combination.
Opera: use SHIFT + ESC, and when the list appears, use the accesskey assigned to the element
Typically the form controls and the body object support the accessKey attribute. Some other elements also support this attribute, but only if the tabIndex attribute is also specified.
JavaScript page for this attribute: accessKey. You can find other example(s) there.

Possible values:

A single character from the keyboard.
Default: this attribute has no default value.

Example HTML code 1:

This example illustrates the use of the accessKey attribute:
<input type="text" value="Activate accesskey: '5'" size="30" accesskey="5" />
Did you find this example helpful? yes no

Supported by tags:

External links:

User Contributed Comments

Post Content

Post Content