WAI-ARIA refers to the Web Accessibility Initiative - Accessible Rich Internet Applications. It is a technical specification written by the World Wide Web Consortium (W3C). WAI-ARIA is often called ARIA for short. ARIA enabled accessible landmark navigation landmarks in HTML4, JavaScript widgets, form hints and error messages, live content updates, and much more. But many of these were later incorporated into HTML5.
You should always use the correct semantic HTML element instead of using ARIA. One reason for this is that the native elements already have built-in keyboard accessibility, roles, and states. A good example of this is a <button>
element. A button can be accessed with a keyboard. Often I've seen people use <div>
elements instead of buttons. Divs cannot be accessed with a keyboard by default so if you use the element like this, you will need to create the keyboard functionality for the element yourself.
ARIA is a great thing, but always remember to be careful when implementing it. In the worst scenario, you might completely ruin the user experience of your non-visual users and make the site inaccessible. Even the specification says that no ARIA is better than bad ARIA.
The ARIA specification defines five rules of ARIA use:
Check out Using ARIA page on w3.org for more on these rules
There are three main components of ARIA. They are roles, properties, and states. Roles are used to define a type of user interface (UI) element. Properties and states can be applied to elements and are used together to support ARIA roles existing on a page. States can change on their own or with user interaction, usually with JavaScript. Properties rarely change once they’re set.