Ensure Every accesskey Attribute Value Is Unique

Yotam Flohr
Researcher
Blind Low vision Mobility
WCAG 2.1 Level A

Written and researched for humans by humans

Yotam Flohr
Researcher
Ritvik Shrivastava
Expertly reviewed by
Comments: 0
Your entire domain
Get detailed instructions on how to resolve every accessibility issue on your website

All accesskey attribute values in an HTML document must be unique. This means accesskeys must not be repeated to prevent unexpected issues for keyboard users.

Why It Matters

Users should have the ability to quickly activate or move the focus to a specific element by pressing the specified key. Duplicating accesskey values makes the page less accessible for people with low vision or mobility impairments.

Fixing the Issue

Ensures that each element on the page with an accesskey attribute has a unique value.

Good Code Example

Code example
<a href="google.com" accesskey="g">Link to Google</a> <a href="github.com" accesskey="h">Link to GitHub</a> Copy

Although the “providing access keys” option exists, it’s not recommended that you include accesskey attribute values due to limitations:

  • Access keys are not supported by every browser.
  • Access keys are not always obvious to the user.
  • Access keys defined by the developer may conflict with default browser access keys.
  • Using a letter from a label element as access key may cause problems when rendering content in multiple languages