HTML Element vs ARIA Role

HTML elements and ARIA are used to define various types of interactive elements on a webpage. HTML elements come with built-in keyboard accessibility, roles and states. In ARIA, the keyboard accessibility, roles and states are user-defined.

screenshot of a web form
Figure 1: A HTML form coded using native HTML and ARIA

When an interactive element cannot be made accessible using native HTML, then ARIA comes into picture.

Usually, either HTML or ARIA or both CAN be used for defining elements on a webpage. However, due to inbuilt functionalities or baked in accessibility, native HTML is given precedence over ARIA for simple elements.

When dynamic or complex functionality appears, ARIA is preferred over native HTML or a mixture of both is used since it provides flexibility for developers. For more information refer to Dynamic Update, Autocomplete, Critical Alerts, Progress Alerts, and Notifications components.

Some examples where ARIA is preferred over HTML are carousel, listbox, application menu, editable combobox and so on. For more information on these examples, refer to Modal Dialog, Content Slider, Toggle Buttons, Tabbed Interface, Tooltips & Toggletips, Collapsible Sections, Multiselect box, Dual Listbox, and Menu and Menu Buttons components.

NOTE:

  • New to accessibility or uncertain of requirements, it will be helpful to review all sections below.
  • Already familiar with requirements, skip to the “Working Example” section for sample HTML, CSS and JavaScript (when needed), along with a working demo.