ARIA (Accessible Rich Internet Applications) roles can make custom user interface patterns more accessible, but they should not be used to recreate semantics that HTML already provides. When a native HTML element already matches the intended semantics and behavior, prefer that element over adding a role to a generic container.
For example, instead of using a div element with a button role (<div role="button">Click me</div>), use a button element
(<button>Click me</button>).
Using the native element preserves built-in semantics, browser behavior, keyboard interaction, and assistive technology support with less code to maintain. ARIA is still appropriate when no suitable HTML element exists for the pattern you need, or when the available HTML elements do not fit the component’s structure or behavior.
<div role="button" onClick="myFunction()">Click me</div> <!-- Noncompliant -->
Replace the ARIA role with an appropriate HTML tag.
<button onClick="myFunction()">Click me</button>