ARIA DOM Properties: Setting Roles, Properties and States
In addition to using in-line HTML code and the setAttribute
and getAttribute
DOM methods for setting ARIA roles, properties and states, new DOM properties will also be available through the IDL Interface requirements defined in ARIA 1.2 Editor's Working Draft.
Setting ARIA Role
Role |
tablist |
Inline |
<div role="tablist"> |
setAttribute |
e.setAttribute("role", "tablist"); |
DOM Property (ARIA 1.2) |
e.role = tablist"; |
Setting Accessible Name
Attribute |
aria-label |
Inline |
<div role="button" aria-label="Play"> |
setAttribute |
e.setAttribute("aria-label", "play"); |
DOM Property (ARIA 1.2) |
e.ariaLabel = "Play"; |
Setting State
Attribute |
aria-checked |
Inline |
<div role="checkbox" aria-checked="mixed"> |
setAttribute |
e.setAttribute("aria-checked", "mixed"); |
DOM Property (ARIA 1.2) |
e.ariaChecked = "mixed"; |
NOTE: ARIA DOM Properties are only available on the most recent browser releases.