ARIA (Accessible Rich Internet Applications) offers web developers a way to make sure that all content
on a given site is accessible and well-described. It is not, however, a substitute for semantic HTML which,
if used properly, often abrogates the need to use ARIA roles, attritbutes, or properties in the first place.
In this lesson, we explore what ARIA is and does and when to apply ARIA practices.
Attributes describe the states and properties of an element. Broadly speaking, defining these in HTML
means using sensible default values representing initial states, changing these when scripts alter
their values in the course of page use.
While this course will revisit ARIA attributes during work with Javascript, an example of where it’s easier
to use semantics demonstrates much of the above discussion. The cannonical example is a progress bar (courtesy
of MDN). Initially,
a developer could build:
<div
id="percent-loaded"
role="progressbar"
aria-valuenow="75"
aria-valuemin="0"
aria-valuemax="100"></div>
The above element is perfectly usable. It features a role, several attributes which model a progress bar
and cater to accessibility. However, there exists a semantic <progress> element:
This element has all of the above ARIA values built in based on its semantic purpose. It’s easier to use,
and incorporates less overall maintenance work and, possibly, scripting work.