About this AccessLint rule
The accesskey attribute assigns a keyboard shortcut to an HTML element, allowing users to activate or focus it by pressing a key combination. When two or more elements on the same page share the same accesskey value, the browser cannot reliably determine which element to activate. In most browsers, only the first element with the duplicated value receives focus, and the rest are silently ignored. This makes the shortcut unreliable and confusing.
Keyboard-only users and screen reader users are the most affected. These users often depend on keyboard shortcuts to navigate a page efficiently. If a duplicated accesskey sends focus to the wrong element, or if an expected shortcut appears to do nothing, it can block users from reaching content or completing tasks. Sighted keyboard users may also struggle to understand why a documented shortcut is not working as expected.
This rule relates to WCAG Success Criterion 4.1.1 Parsing (Level A) and the broader principle that user interface components must behave predictably. Duplicate accesskey values create ambiguous markup that browsers interpret inconsistently.
How to fix it
Audit the page for all elements that use the accesskey attribute and make sure every value is unique. If two elements currently share the same key, change one of them to a different character.
A few practical considerations:
accesskeyshortcuts can conflict with built-in browser shortcuts and screen reader key combinations. For example,accesskey="s"may collide with the browser's "Save" shortcut. Useaccesskeyvalues sparingly, and prefer characters that are less likely to conflict (digits are sometimes safer than letters).- If the shortcut is not truly necessary, removing the
accesskeyattribute entirely is a valid fix. Navigation landmarks, skip links, and proper heading structure often provide a better experience than access keys. - When access keys are used, document them somewhere on the page so users know they exist.
Examples
Duplicate accesskey values (incorrect)
In this example, both the search field and the submit button use accesskey="s". The browser will typically send focus to the search field and ignore the button's shortcut.
<label for="search">Search</label>
<input type="text" id="search" accesskey="s">
<button type="submit" accesskey="s">Submit</button>
Unique accesskey values (correct)
Each element has a distinct accesskey value, so both shortcuts work as expected.
<label for="search">Search</label>
<input type="text" id="search" accesskey="s">
<button type="submit" accesskey="b">Submit</button>
Removing unnecessary access keys (also correct)
If the shortcuts are not needed, removing the accesskey attribute avoids the problem entirely and eliminates potential conflicts with browser or assistive technology shortcuts.
<label for="search">Search</label>
<input type="text" id="search">
<button type="submit">Submit</button>
Detect accessibility issues automatically
Rocket Validator scans your site with complementary accessibility engines, helping teams find issues across every page.
Help us improve our guides
Was this guide helpful?
Validate at scale.
Ship accessible websites, faster.
Automated HTML & accessibility validation for large sites. Check thousands of pages against WCAG guidelines and W3C standards in minutes, not days.
Pro Trial
Full Pro access. Cancel anytime.
Start Pro Trial โJoin teams across 40+ countries