Do I need aria attributes or roles on native elements?

Question

Do I need to add aria attributes on native elements (eg. <button role="button>)?

Answer

Most of the time, no you don’t. If you are using a <button> element as a button or an <a> element as a link, you should not add any ARIA role attributes. But there are certain instances where you would.

For example, let’s say you are using an anchor element (<a>) to function as a button. Since it no longer functions as a link, you’ll need to add the role=”button” attribute, make sure it has accessible text (the text within the element or via an aria-label attribute) and follow the keyboard interaction requirements per the ARIA design pattern.

Free Tools to Continue Learning

Accessible Web Company Logo

Accessible Web RAMP

Monitor your website and manage your progress towards WCAG conformance.

Accessible Web Company Logo

Accessible Web Academy

Career specific courses to help power up your accessibility knowledge.