Elements with role="button" or role="link" lack tabindex and keyboard handler, making them inaccessible to keyboard users.
By Seoxpert Editorial · Published
Elements with ARIA roles like 'button' or 'link' must be keyboard accessible for all users, including those using assistive technology. Failing to provide proper keyboard support breaks accessibility guidelines and can harm user experience and site reputation.
Keyboard and assistive tech users cannot interact with these elements, reducing accessibility and potentially violating WCAG standards.
Automated crawlers scan for elements with role="button" or role="link" that lack a non-negative tabindex and a keyboard event handler.
Problem: Missing tabindex and handler
<div role="button">Click me</div>Fix: Use native button
<button>Click me</button>Fix: Add tabindex and keyboard handler
<div role="button" tabindex="0" onclick="doSomething()" onkeydown="if(event.key==='Enter'||event.key===' '){doSomething();}">Click me</div>Because it doesn't make the element focusable or operable by keyboard, which is required for accessibility.
No, you also need a handler so the element responds to Enter and Space keys like a real button.
Using a native <button> is always better for accessibility and requires less code.
Keyboard users and assistive technology may not be able to interact with your controls, failing accessibility standards.
Run a scan to see if `role="button"` / `role="link"` Elements Missing `tabindex` or Handler affects your pages.
Scan my website →