Skip to main content
Version: v6

We detected an element functioning as a link missing a link role

We detected an element functioning as a link missing a link role — rule summary
FieldValue
Rule codeManual_Link_Role_Missing
WCAG conformance levelA
WCAG success criterion4.1.2 Name, Role, Value
Must be fixed at sourceNo

Description

When custom elements are used to create link-like functionality, they must be assigned the appropriate ARIA role to ensure that assistive technologies understand their purpose. Without the proper role, users of screen readers and other assistive technologies may be unable to identify or interact with these controls correctly.

How to fix

When creating custom link elements, always add role="link" and appropriate ARIA attributes to ensure accessibility:

<div class="custom-link" 
role="link"
target="/somePage"
tabindex="0"
> Whenever possible, use the native <link> element instead of creating custom links, as it provides built-in accessibility and behavior.