[accesskey]
values are not unique
— Updated
Appears in: Accessibility audits
Access keys let users quickly focus or activate an element on your page by pressing the specified key, usually in combination with the Alt
key (or Control+Alt
on Mac).
Duplicating accesskey
values creates unexpected effects for users navigating via the keyboard.
How the Lighthouse access key audit fails #
Lighthouse flags pages with duplicate access keys:
For example, these links both have g
as their access key:
<a href="google.com" accesskey="g">Link to Google</a>
<a href="github.com" accesskey="g">Link to GitHub</a>
How to fix duplicate access keys #
Evaluate the duplicate accesskey
values flagged by Lighthouse and make each accesskey
value unique. For example, to fix the example above, you can change the value for the GitHub link:
<a href="google.com" accesskey="g">Link to Google</a>
<a href="github.com" accesskey="h">Link to GitHub</a>
For each defined accesskey
, make sure the value doesn't conflict with any default browser or screen reader shortcut keys.
Resources #
- Source code for
[accesskey]
values are not unique audit - accesskey attribute value must be unique (Deque University)
Last updated: — Improve article