Skip to content
easeweb

Learn

HTML and ARIA reference

The HTML and ARIA that matter for accessibility: what each one does for it, with an example and the guides that use it.

HTML elements

53 entries in 8 groups

Document and metadata

3 entries

<meta>

Page metadata: the character set, the viewport, a description. Never set maximum-scale=1 or user-scalable=no in the viewport: it stops people zooming on mobile.

Example
<meta name="viewport" content="width=device-width, initial-scale=1">

Sections and landmarks

9 entries

<header>

Introductory content, such as the site’s logo and navigation. It is the banner landmark only when it is not inside <article>, <aside>, <main>, <nav> or <section>; there it is just a header for that part.

Example
<header>
  <a href="/">Fern & Fold</a>
  <nav aria-label="Main">…</nav>
</header>

<nav>

A major block of navigation links. With more than one on a page, name each with aria-label (“Main”, “Footer”) and leave the word “navigation” out: the screen reader says it.

Example
<nav aria-label="Main">
  <ul>…</ul>
</nav>

<main>

The page’s main content, once per page (others must be hidden). Screen reader users jump straight to it, and a skip link can point to it.

Example
<main id="content">
  <h1>Your basket</h1>
</main>

<section>

A thematic section of the page, normally with a heading. It becomes a region landmark only when it has a name, such as aria-labelledby pointing to that heading.

Example
<section aria-labelledby="faq">
  <h2 id="faq">Questions</h2>
</section>

<h1>–<h6>

Headings, ranked by level. Screen reader users list them and jump between them, so give the page one <h1>, don’t skip levels going down, and choose the level by structure, not size.

Example
<h1>Delivery</h1>
<h2>UK orders</h2>
<h2>International orders</h2>
Related
role="heading"aria-level
Guides that use it (58)

<aside>

Content related to the page but separate from its main content, such as a sidebar. It is a complementary landmark; name it when there is more than one.

Example
<aside aria-label="Related articles">…</aside>

Grouping content

6 entries

<ul>

An unordered list of items. Outside <nav>, Safari with VoiceOver drops the list role when list-style: none is set; add role="list" if the count matters there.

Example
<ul>
  <li>Free returns</li>
  <li>Next-day delivery</li>
</ul>
Related
role="list"<li>
Guides that use it (40)

<ol>

An ordered list, where the sequence matters, such as steps. Screen readers say how many items there are and which one you are on.

Example
<ol>
  <li>Add to basket</li>
  <li>Pay</li>
</ol>

<li>

An item in <ol>, <ul> or <menu>. It must be a direct child of one of them, or it is not counted as part of the list.

Example
<ul>
  <li><a href="/shop">Shop</a></li>
</ul>
Related
role="listitem"
Guides that use it (38)

<dl>

A description list of term and description pairs, such as specifications or a glossary. Keep only <dt>, <dd> and wrapping <div> elements directly inside it.

Example
<dl>
  <dt>Weight</dt>
  <dd>220 g</dd>
</dl>

<figure>

Self-contained content such as an image, chart or code sample, usually with a <figcaption> that names it. The caption does not replace an image’s alt.

Example
<figure>
  <img src="chart.png" alt="Sales doubled from May to June">
  <figcaption>Sales, 2026</figcaption>
</figure>

Text

7 entries

<a>

A link to another page or place: a link only with an href, and reached with Tab and Enter. Its text must say where it goes; for an action on the page, use <button>.

Example
<a href="/returns">Returns policy</a>
Related
role="link"hrefaria-current
Go deeper
Compare: Link or button
Guides that use it (45)

<abbr>

An abbreviation. Its title attribute is not reliably read or shown on touch screens, so spell the term out in the text the first time it appears.

Example
<p>Web Content Accessibility Guidelines (<abbr>WCAG</abbr>)</p>
Related
title

<ruby>

Ruby annotation: small text above or beside characters, such as furigana showing how kanji are read. Screen readers vary in how they read it, often saying both base and ruby.

Example
<ruby>漢字<rp>(</rp><rt>かんじ</rt><rp>)</rp></ruby>

<mark>

Text highlighted for reference, such as search matches. Many screen readers don’t announce it, so don’t rely on the highlight alone to convey something.

Example
<p>Results for <mark>notebook</mark> covers</p>

<del>

Text removed from the document, for a record of edits. Most screen readers don’t announce it by default, so say in words what changed if it matters.

Example
<p>Open <del>until 6pm</del> <ins>until 8pm</ins>.</p>
Related
<ins><s>

<ins>

Text added to the document, for a record of edits. Most screen readers don’t announce it by default.

Example
<p>Open <ins>until 8pm</ins> on Fridays.</p>
Related
<del>

Images, media and embedded content

8 entries

<img>

An image. alt is required: describe what the image tells the reader, or use alt="" for a decorative image so screen readers skip it. Without alt, many screen readers read the file name.

Example
<img src="mug.jpg" alt="Blue enamel mug with a white rim">

<area>

A clickable area in an image map. With an href it is a link, and its alt is the link text, so it is required.

Example
<area shape="circle" coords="120,80,30" href="/toilets" alt="Toilets">

<svg>

An inline SVG drawing. For a meaningful image, add role="img" and a name with aria-label or <title>; for decoration, add aria-hidden="true".

Example
<svg role="img" aria-label="Rated 4 out of 5" viewBox="0 0 80 16">…</svg>

<canvas>

A surface drawn on with script. What is drawn is invisible to assistive technology, so give the same information as text, in the fallback content or nearby.

Example
<canvas width="400" height="200">
  <p>Visitors rose from 200 in May to 450 in June.</p>
</canvas>

<video>

A video player. Add controls, captions with <track>, and an audio description or transcript; don’t autoplay with sound.

Example
<video src="tour.mp4" controls>
  <track kind="captions" src="tour.en.vtt" srclang="en" label="English">
</video>

<track>

How captions and audio descriptions reach a <video>: a WebVTT file whose kind says which it is. Prerecorded video with sound needs captions (WCAG 1.2.2).

Example
<track kind="captions" src="tour.en.vtt" srclang="en" label="English" default>

Tables

4 entries

<table>

A data table, where screen readers announce each cell with its headers. Use it for data in rows and columns, not for layout, and give it a <caption>.

Example
<table>
  <caption>Delivery prices</caption>
  …
</table>

<th>

A header cell for its column or row. Set scope="col" or scope="row" so its direction is clear, and use headers for complex tables.

Example
<th scope="col">Price</th>

Forms

13 entries

<form>

A form that submits its fields. Submitting with Enter works only inside one. It is a form landmark only when it has a name.

Example
<form action="/subscribe" method="post" aria-label="Newsletter">…</form>

<fieldset>

Groups related fields, such as a set of radio buttons or an address, under the question in its <legend>, which screen readers announce with the fields.

Example
<fieldset>
  <legend>Delivery speed</legend>
  …
</fieldset>

<legend>

The caption of a <fieldset>, as its first child. Keep it short: some screen readers repeat it on every field in the group.

Example
<legend>Payment method</legend>

<label>

The visible name of a form field, tied to it with for and the field’s id, or by wrapping it. It is read when the field gets focus, and clicking it focuses the field.

Example
<label for="email">Email</label>
<input id="email" type="email" autocomplete="email">
Related
for<input>
Go deeper
Compare: Names and descriptions
Guides that use it (50)

<input>

A form field whose type sets what it is: text, email, checkbox, radio, number, date and more. Every one needs a label, and the right type and autocomplete give people the right keyboard and autofill.

Example
<label for="tel">Phone</label>
<input id="tel" type="tel" autocomplete="tel">
Related
role="textbox"role="searchbox"role="checkbox"role="radio"role="button"role="slider"role="spinbutton"role="combobox"<label>typeautocompletename
Guides that use it (47)

<textarea>

A multi-line text field. Like any field it needs a label; don’t stop it being resized if people may need more room.

Example
<label for="note">Gift message</label>
<textarea id="note" rows="4"></textarea>

<select>

A list of options to choose from, with keyboard and screen reader support built in. Give it a label, and don’t submit or navigate when the selection changes.

Example
<label for="size">Size</label>
<select id="size" name="size">
  <option>A5</option>
</select>

<optgroup>

Groups related options in a <select> under a label, which many screen readers announce with the options.

Example
<optgroup label="Notebooks">
  <option>A5 dotted</option>
</optgroup>

<button>

A button that does something on the page. It is focusable and works with Enter and Space for free. Inside a form it submits by default, so set type="button" for other actions.

Example
<button type="button" aria-expanded="false">Menu</button>
Related
role="button"typearia-pressed
Go deeper
Compare: Link or button
Guides that use it (75)

<meter>

A measurement within a known range, such as password strength, which screen readers announce with its value. Give it a label, and say the level in text too, not by colour alone (WCAG 1.4.1). For task progress, use <progress>.

Example
<label for="disk">Storage</label>
<meter id="disk" min="0" max="10" value="7">7 of 10 GB</meter>

Interactive elements

3 entries

<details>

A disclosure widget that shows and hides its content when its <summary> is pressed, with keyboard and screen reader support built in. Several with the same name open one at a time.

Example
<details>
  <summary>Delivery and returns</summary>
  <p>Free returns within 30 days.</p>
</details>

<summary>

The always-visible label of a <details> that opens and closes it. Most browsers expose it as a button-like control with its expanded state, though the exact role varies; don’t put other interactive elements inside it.

Example
<summary>Size guide</summary>

<dialog>

A dialog box. Opened with showModal(), it is modal: it moves focus inside, makes the rest of the page inert and closes with Esc. Give it a name from its heading.

Example
<dialog aria-labelledby="del-title">
  <h2 id="del-title">Delete this list?</h2>
  …
</dialog>

HTML attributes

42 entries in 7 groups

Global attributes

12 entries

lang

Sets the language of the element's content, so screen readers pronounce it with the right voice and browsers hyphenate and translate it correctly. Set it on <html> for the page (WCAG 3.1.1) and on any passage in another language (WCAG 3.1.2).

Example
<html lang="en">
  …
  <p>The French call it <i lang="fr">l'esprit de l'escalier</i>.</p>

dir

Values ltrrtlauto

Sets the text direction. Use rtl for Arabic, Hebrew and other right-to-left scripts, and auto for user-generated text whose direction is not known in advance.

Example
<p lang="ar" dir="rtl">مرحبا بكم</p>
Related
lang

title

Advisory text shown as a tooltip on mouse hover. Do not rely on it: keyboard and touch users never see it, and screen readers read it inconsistently. Its one dependable use is naming an <iframe>.

Example
<iframe src="/map" title="Map of our shop on Hill Street"></iframe>

hidden

Values hiddenuntil-found

Hides the element from everyone: it is not shown, not focusable and not read by screen readers. With until-found, the content stays findable with the browser's find in page and opens when found.

Example
<div id="details-panel" hidden>Delivery takes 2 to 4 days.</div>
Go deeper
Compare: Hiding content
Guides that use it (33)

inert

Makes an element and everything in it unreachable: it cannot be focused, clicked or found by a screen reader, though it stays visible. Use it on the page behind a custom modal or on content that is shown but not yet usable.

Example
<main inert>…</main>
<div role="dialog" aria-modal="true" aria-labelledby="dlg-title">…</div>

tabindex

Values integer (use 0 or -1)

Controls whether an element takes keyboard focus. 0 adds it to the Tab order in source order, -1 lets scripts focus it without putting it in the Tab order. Never use a positive number: it jumps the element ahead of everything else.

Example
<h2 id="results-title" tabindex="-1">12 results</h2>

autofocus

Moves focus to the element when the page or dialog opens. Use it only where people expect to start, such as the first field of a dialog; elsewhere it skips content a screen reader user has not heard yet.

Example
<dialog>
  <label for="rename">New name</label>
  <input id="rename" autofocus>
</dialog>

accesskey

Assigns a keyboard shortcut to an element. Avoid it: the keys clash with screen reader, browser and system shortcuts, the modifier differs between browsers, and nothing tells people the shortcut exists.

Example
<a href="/search" accesskey="s">Search</a>

contenteditable

Values truefalseplaintext-only

Makes the element's content editable in place. The browser exposes it as an editable text area, but it has no name: give it a label with aria-labelledby or aria-label, and aria-multiline where it takes several lines.

Example
<p id="note-label">Note</p>
<div contenteditable="true" role="textbox" aria-labelledby="note-label" aria-multiline="true"></div>

inputmode

Values nonetextdecimalnumerictelsearchemailurl

Chooses which on-screen keyboard to show, such as a number pad for a one-time code, without the validation and spin buttons of type="number".

Example
<label for="code">Security code</label>
<input id="code" inputmode="numeric" autocomplete="one-time-code">

role

Gives an element one of the ARIA roles, which tells assistive technology what it is. It changes only what is announced, never behaviour, so a native element that already has the role is better (see the ARIA roles below).

Example
<div role="status">3 results</div>

popover

Values automanualhint

Turns an element into a popover shown in the top layer, opened by a button with popovertarget. An auto popover closes with Escape and when you click outside it; popover does not trap focus or make the page inert, so it is not a modal dialog.

Example
<button type="button" popovertarget="help">Help</button>
<div id="help" popover>Codes are on the back of your card.</div>

Document and metadata

1 entries

http-equiv

Values content-typedefault-stylerefreshcontent-security-policyx-ua-compatible

Makes a <meta> act like an HTTP header. Avoid http-equiv="refresh" with a delay: a page that reloads or redirects on its own takes people away before they finish reading (WCAG 2.2.1).

Example
<meta http-equiv="content-security-policy" content="default-src 'self'">
2 entries

href

The URL a link goes to. An <a> without href is not a link and cannot be focused; never use href="#" or javascript: to make a link act as a button.

Example
<a href="/returns">Returns policy</a>
Use on
<a><area>
Related
role="link"<button>
Guides that use it (48)

target

Values _self_blank_parent_topname

Where to open the link. _blank opens a new tab or window, which disorients people and breaks the Back button, so use it sparingly and say so in the link text.

Example
<a href="/terms.pdf" target="_blank">Terms (PDF, opens in a new tab)</a>

Images, media and embedded content

8 entries

alt

The text alternative for an image: what it conveys in this context (WCAG 1.1.1). Use alt="" for a purely decorative image so screen readers skip it; leaving alt out makes many read the file name.

Example
<img src="chart.png" alt="Sales rose 40% between April and June.">

controls

Shows the browser's own playback controls, which work with the keyboard and screen readers. Keep them unless you build a custom player that is just as accessible.

Example
<video src="tour.mp4" controls>
  <track kind="captions" src="tour.en.vtt" srclang="en" label="English">
</video>

autoplay

Starts playback as soon as it can. Sound that plays on its own for more than 3 seconds needs a way to pause or mute it (WCAG 1.4.2), and moving video needs a pause control (WCAG 2.2.2); better not to autoplay at all.

Example
<video src="loop.mp4" autoplay muted loop playsinline controls></video>

kind

Values subtitlescaptionsdescriptionschaptersmetadata

What a text track is. Use captions for dialogue plus sound effects for deaf viewers (WCAG 1.2.2), subtitles for when the sound can be heard but not understood, such as a translation, and descriptions for text audio description.

Example
<track kind="captions" src="talk.en.vtt" srclang="en" label="English">

default

Turns this text track on by default. Put it on the captions in the page's language, so captions are there without hunting for the setting.

Example
<track kind="captions" src="talk.en.vtt" srclang="en" label="English" default>
Use on
<track>
Related
kind

Tables

5 entries

scope

Values colrowcolgrouprowgroup

Says whether a header cell labels its column, row or group of them, so screen readers read the right header with each data cell.

Example
<th scope="row">Saturday</th>

abbr

A short form of a header cell's text, for when the full header is long. Screen reader support is patchy, so keep the visible header itself reasonably short.

Example
<th scope="col" abbr="Qty">Quantity ordered</th>
Use on
<th>

rowspan

How many rows a cell spans. As with colspan, keep merged cells to a minimum so people can follow the table cell by cell.

Example
<th rowspan="3" scope="rowgroup">Weekdays</th>

Forms

10 entries

for

Ties a <label> to the control with that id, which gives the control its accessible name and makes clicking the label focus or toggle the control.

Example
<label for="postcode">Postcode</label>
<input id="postcode" autocomplete="postal-code">
Use on
<label><output>
Related
aria-labelledby
Guides that use it (39)

label

Names an <optgroup>, which many screen readers announce with its options, or a <track>, shown in the player’s captions menu, where the language should be named in words people recognise.

Example
<optgroup label="Europe">
  <option>Lisbon</option>
</optgroup>

name

Groups radio buttons, so the arrow keys move between them and screen readers say how many there are. It is not an accessible name: each control still needs a label.

Example
<input id="size-s" type="radio" name="size" value="s">
<label for="size-s">Small</label>
Use on
<input><button><select><textarea><form><fieldset><output><iframe><meta><details>
Related
aria-label
Guides that use it (40)

type

On <input>, the kind of control (text, email, checkbox, date…), which sets its role, keyboard and validation. On <button>, submit, reset or button: set type="button" on any button that does not submit a form.

Example
<button type="button" aria-expanded="false" aria-controls="filters">Filters</button>
Use on
<input><button><ol><a>
Related
inputmode
Guides that use it (88)

autocomplete

Values nameemailtelstreet-addresspostal-codecc-numberusernamenew-passwordcurrent-passwordone-time-codeoff…

Says what personal data a field collects, so browsers and password managers can fill it in. Fields about the user need the matching token (WCAG 1.3.5), which also saves typing for people with motor and memory impairments.

Example
<label for="email">Email</label>
<input id="email" type="email" autocomplete="email">

required

Makes a field mandatory: the browser blocks submission and screen readers announce the field as required. Also show that it is required in the visible label, not with colour or an unexplained asterisk alone.

Example
<label for="name">Full name (required)</label>
<input id="name" autocomplete="name" required>

disabled

Disables a form control: it is removed from the Tab order, cannot be used and is not submitted. Because it cannot be focused, people may not find it or learn why it is off; aria-disabled keeps it focusable instead.

Example
<button type="submit" disabled>Place order</button>

list

Ties a field to a <datalist>, so the browser offers suggestions and handles their keys itself, while people can still type anything. Simpler than a scripted combobox when the list needn’t be styled.

Example
<label for="city">City</label>
<input id="city" list="cities">
<datalist id="cities"><option value="Osaka"></option></datalist>

Interactive elements

4 entries

open

Shows the content of a <details> element, or shows a <dialog>. Open a dialog with showModal() instead of setting open, so it is modal and focus moves into it.

Example
<details open>
  <summary>Delivery</summary>
  <p>Free over ¥5,000.</p>
</details>

popovertarget

Makes a button open, close or toggle the popover with that id. The browser exposes the button's expanded state and, if focus is inside the popover when it closes, moves focus back to where it was before (usually the button).

Example
<button type="button" popovertarget="menu">Account</button>
<div id="menu" popover>…</div>

command

Values show-modalcloserequest-closeshow-popoverhide-popovertoggle-popover--custom

Opens or closes a <dialog> or popover from a button with no script. show-modal opens a dialog as showModal() does: modal, with focus moved inside and the page behind inert.

Example
<button type="button" commandfor="confirm" command="show-modal">Delete</button>

commandfor

Names, by id, the dialog or popover a button’s command acts on, so the button works without a script, even before scripts have loaded.

Example
<button type="button" commandfor="confirm" command="close">Cancel</button>

ARIA roles

63 entries in 6 groups

Widget roles

18 entries

role="checkbox"

A box that is checked, unchecked or, with aria-checked="mixed", partly checked. Requires aria-checked, focus and Space to toggle it. Prefer <input type="checkbox">.

Example
<div role="checkbox" aria-checked="false" tabindex="0">
  Email me updates
</div>

role="menuitemcheckbox"

A menu item that can be checked or unchecked, such as “Show grid”. Requires aria-checked; activating it toggles the state and usually leaves the menu open.

Example
<li role="menuitemcheckbox" aria-checked="true" tabindex="-1">
  Show grid
</li>

role="menuitemradio"

One of a set of menu items where only one can be checked, such as a sort order. Requires aria-checked; group the set with role="group" or separators.

Example
<li role="menuitemradio" aria-checked="true" tabindex="-1">
  Newest first
</li>

role="textbox"

A field for free text; with aria-multiline="true", one that takes several lines. Prefer <input> or <textarea>; a contenteditable element needs the role and a name.

Example
<div role="textbox" contenteditable="true" aria-multiline="true"
  aria-label="Message"></div>

role="spinbutton"

A field holding a number that the Up and Down arrows step through. Set aria-valuenow when it has a value. Prefer <input type="number"> for real quantities.

Example
<div role="spinbutton" aria-label="Quantity" tabindex="0"
  aria-valuenow="1" aria-valuemin="1">1</div>

role="gridcell"

A cell in a grid or treegrid, which can take focus or be edited. It must be owned by a row in a grid; the arrow keys move between cells.

Example
<div role="row">
  <div role="gridcell" tabindex="-1">Mon 3</div>
</div>

Composite widget roles

9 entries

role="combobox"

A field that pops up a listbox, grid, tree or dialog of suggestions. Requires aria-expanded and, in ARIA 1.2, aria-controls pointing at the popup; use aria-activedescendant for the highlighted option.

Example
<input role="combobox" aria-expanded="false" aria-controls="cities"
  aria-autocomplete="list" aria-label="City">

role="listbox"

A list of options to choose one or, with aria-multiselectable, several. It needs a name and options; the arrow keys move the selection. Prefer <select> where it fits.

Example
<ul role="listbox" aria-label="City" tabindex="0">
  <li role="option" aria-selected="true">Tokyo</li>
</ul>

role="menu"

A list of actions or settings, like an application’s menu. It is not for site navigation links: screen readers switch to menu mode and expect arrow-key behaviour.

Example
<ul role="menu" aria-label="File">
  <li role="menuitem" tabindex="-1">Open</li>
</ul>

role="menubar"

A row of menus that usually stays visible, as in a desktop application. Left and Right move between its items; like menu, it is not for a website’s navigation.

Example
<ul role="menubar" aria-label="Editor">
  <li role="menuitem" aria-haspopup="menu" tabindex="0">File</li>
</ul>

role="treegrid"

A grid whose rows can be expanded and collapsed like a tree, such as an email thread list. Rows take aria-expanded and aria-level.

Example
<div role="treegrid" aria-label="Inbox">
  <div role="row" aria-level="1" aria-expanded="true">…</div>
</div>

Document structure roles

22 entries

role="rowgroup"

A group of rows, such as a table’s head or body. Prefer <thead>, <tbody> and <tfoot>.

Example
<div role="rowgroup">
  <div role="row">…</div>
</div>
Related
role="row"

role="img"

One image, possibly made of several parts, such as an inline SVG, emoji or icon font. It needs aria-label or aria-labelledby; its children are not read.

Example
<svg role="img" aria-label="4 out of 5 stars" viewBox="0 0 80 16">
  …
</svg>

role="figure"

A self-contained illustration, chart or code sample, usually with a caption. Prefer <figure> with <figcaption>.

Example
<div role="figure" aria-labelledby="fig-1">
  <img src="sales.png" alt="…">
  <p id="fig-1">Sales by month</p>
</div>

role="group"

A set of related elements that isn’t a landmark, such as related fields or the options in a menu section. Give it a name when the grouping matters. Prefer <fieldset> for form fields.

Example
<div role="group" aria-labelledby="addr">
  <h3 id="addr">Delivery address</h3>
  …
</div>

role="toolbar"

A set of controls, such as text formatting buttons. Give it a name when there is more than one; only one control is in the Tab order and the arrow keys move between them.

Example
<div role="toolbar" aria-label="Formatting">
  <button type="button" aria-pressed="false">Bold</button>
</div>

role="separator"

A divider between sections or menu groups. Prefer <hr>. A focusable separator is a widget that resizes panes, and then needs aria-valuenow.

Example
<div role="separator" aria-orientation="vertical" tabindex="0"
  aria-valuenow="30" aria-label="Resize sidebar"></div>

role="tooltip"

A short description that appears when its owner has focus or the pointer. It never takes focus itself; the owner points to it with aria-describedby, and Escape hides it.

Example
<button type="button" aria-describedby="tip">Share</button>
<div role="tooltip" id="tip">Copy a link to this page</div>

role="note"

A note that is parenthetical or ancillary to the main content, such as a tip beside a step.

Example
<div role="note">
  <p>Tip: keep your receipt.</p>
</div>

role="article"

A self-contained piece, such as a post, a comment or a product card. Prefer <article>.

Example
<div role="article" aria-labelledby="post-1">
  <h2 id="post-1">Spring menu</h2>
</div>

role="meter"

A value within a known range, such as disk use or password strength; not progress. Requires aria-valuenow and a name. Prefer <meter>.

Example
<div role="meter" aria-label="Storage used" aria-valuenow="72"
  aria-valuemin="0" aria-valuemax="100"></div>

role="presentation"

The older name for none: removes an element’s role but keeps its content. Ignored on focusable elements and on those with global ARIA; an <img alt=""> already has it.

Example
<ul role="presentation">
  <li role="presentation">…</li>
</ul>

role="application"

Tells screen readers to pass every key to the page, turning off their reading keys. Almost never right: only for a widget that handles all keys itself and needs no reading.

Example
<div role="application" aria-label="Map">
  …
</div>

Landmark roles

8 entries

role="form"

A region holding a form. It is a landmark only when it has a name, so name the forms people need to find. Prefer <form> with aria-label or aria-labelledby.

Example
<div role="form" aria-label="Newsletter">
  …
</div>

role="complementary"

Content that supports the main content but makes sense on its own, such as related links. Name it when there is more than one. Prefer <aside>.

Example
<div role="complementary" aria-label="Related articles">
  …
</div>

Live region roles

4 entries

role="status"

Advisory information, such as “Saved” or a result count, read when the screen reader is free (polite, atomic). Put it on the page empty, before the message arrives.

Example
<p role="status"></p>

Window roles

2 entries

role="alertdialog"

A dialog with an urgent message that needs a response, such as “Delete this file?”. Name it, describe it with aria-describedby, and move focus into it.

Example
<div role="alertdialog" aria-modal="true" aria-labelledby="d-title"
  aria-describedby="d-text">
  …
</div>

ARIA states and properties

47 entries in 5 groups

Names and descriptions

6 entries

aria-label

Values string

Gives an element its accessible name when no visible text does, such as an icon button. Use it on interactive elements and landmarks, not on a div or span with no role, and include any visible label in it so voice control users can say it.

Example
<button type="button" aria-label="Search">
  <svg aria-hidden="true">…</svg>
</button>
Go deeper
Compare: Names and descriptions
Guides that use it (41)

aria-labelledby

Values ID reference list

Names an element with the text of other elements, by their ids, so the name stays in step with what is shown. It takes precedence over aria-label and the element’s own content, and can point to hidden elements.

Example
<h2 id="billing">Billing address</h2>
<section aria-labelledby="billing">…</section>
Go deeper
Compare: Names and descriptions
Guides that use it (32)

aria-describedby

Values ID reference list

Points to elements whose text adds a description to the name, such as a hint or an error under a field. Screen readers usually read it after the name and role, and some only on focus, so don’t put anything essential only there.

Example
<label for="pw">Password</label>
<input id="pw" type="password" aria-describedby="pw-hint">
<p id="pw-hint">At least 12 characters.</p>

aria-description

ARIA 1.3 draft
Values string

Gives an element a description as a string, like aria-describedby without an element to point to. Text that sighted people need too belongs on the page, referenced with aria-describedby, instead.

Example
<button type="button" aria-description="Opens in a new window">Help</button>

aria-details

Values ID reference

Points to an element with longer, structured details about this one, such as a table that explains a chart. Unlike aria-describedby, the details are not read out as a flat string: screen readers that support it say that details exist and let people go to them.

Example
<img src="sales.png" alt="Sales by quarter" aria-details="sales-table">
<table id="sales-table">…</table>

aria-roledescription

Values string

Replaces the spoken name of an element’s role with your own words, such as “slide” for a carousel group. Use it rarely, only on an element with a real role, never on a generic div or span, and never to rename widgets people already know.

Example
<div role="group" aria-roledescription="slide" aria-label="2 of 5">
  …
</div>

Widget states and properties

22 entries

aria-expanded

Values truefalseundefined

Whether the content a control shows and hides is open: put it on the button, menu button or combobox that toggles it, not on the panel, and update it every time. Leave it off a control that expands nothing.

Example
<button type="button" aria-expanded="false" aria-controls="faq-1">
  Delivery times
</button>
<div id="faq-1" hidden>…</div>

aria-haspopup

Values falsetruemenulistboxtreegriddialog

Says that the control opens a popup and what kind: true means menu. Use it only when the popup really has that role, such as menu for a role="menu"; a disclosure that shows plain content needs aria-expanded instead.

Example
<button type="button" aria-haspopup="menu" aria-expanded="false"
  aria-controls="actions">Actions</button>

aria-pressed

Values truefalsemixedundefined

Turns a button into a toggle button and says whether it is pressed, such as Bold or Mute. Keep the name the same when the state changes; changing the label and aria-pressed together says it twice.

Example
<button type="button" aria-pressed="false">Mute</button>

aria-checked

Values truefalsemixedundefined

The checked state of a custom checkbox, radio, switch or checkable menu item; mixed is for a checkbox that stands for a partly checked group. Update it on every change. A native input type="checkbox" needs none.

Example
<div role="checkbox" aria-checked="false" tabindex="0">
  Subscribe
</div>

aria-selected

Values truefalseundefined

Marks the selected item in a tablist, listbox, grid or tree: the open tab, the chosen option. It is not for checkboxes (aria-checked) or the current page in a menu (aria-current).

Example
<button role="tab" aria-selected="true" aria-controls="panel-1">
  Details
</button>

aria-readonly

Values truefalse

Says a custom widget’s value can be read and focused but not changed, such as a grid cell or a textbox. A native input uses the readonly attribute instead.

Example
<div role="textbox" aria-readonly="true" tabindex="0"
  aria-label="Order number">A-10293</div>

aria-required

Values truefalse

Says a field must be filled in, for screen readers only: it doesn’t stop the form submitting. On native fields the required attribute does both; either way, show that the field is required in the visible label too.

Example
<p id="size-q">Size (required)</p>
<div role="radiogroup" aria-labelledby="size-q" aria-required="true">
  <div role="radio" aria-checked="false" tabindex="0">Small</div>
  …
</div>

aria-invalid

Values falsetruegrammarspelling

Says a field’s value fails validation, so screen readers announce it as invalid. Set it after the user submits or leaves the field, not before they type, and pair it with a visible message referenced by aria-describedby or aria-errormessage.

Example
<label for="zip">Postcode</label>
<input id="zip" aria-invalid="true" aria-describedby="zip-err">
<p id="zip-err">Enter a 7-digit postcode.</p>

aria-errormessage

Values ID reference

Points to the element holding a field’s error message. It is only used while the field has aria-invalid="true". Support is still uneven, so many sites also reference the message with aria-describedby.

Example
<label for="email">Email</label>
<input id="email" aria-invalid="true" aria-errormessage="email-err">
<p id="email-err">Enter an email address like [email protected].</p>

aria-placeholder

Values string

A short hint shown in an empty custom textbox or searchbox, like the placeholder attribute. It is not a label: give the field a name as well.

Example
<div role="textbox" contenteditable="true" aria-label="Note"
  aria-placeholder="Add a note"></div>

aria-autocomplete

Values noneinlinelistboth

Tells screen readers that a combobox or text field suggests completions as you type: inline completes the text in the field, list shows a popup of suggestions, both does the two. It describes the behaviour; your script still has to provide it.

Example
<input role="combobox" aria-label="City" aria-autocomplete="list"
  aria-expanded="false" aria-controls="cities">

aria-multiline

Values truefalse

Says a role="textbox" takes more than one line, so people know Enter may add a line rather than submit; your script still has to handle the key. A native textarea already says so.

Example
<div role="textbox" contenteditable="true"
  aria-multiline="true" aria-labelledby="msg-label"></div>

aria-multiselectable

Values truefalse

Says more than one item can be selected at once in a listbox, grid, tablist or tree, so screen readers tell people they can pick several. Mark each chosen item with aria-selected.

Example
<ul role="listbox" aria-multiselectable="true" aria-label="Toppings">
  <li role="option" aria-selected="true">Cheese</li>
</ul>

aria-modal

Values truefalse

Tells screen readers that a dialog is modal, so they treat the rest of the page as out of reach. Use it on a role="dialog" or alertdialog only when the page behind really is inert; a <dialog> opened with showModal() doesn’t need it.

Example
<div role="dialog" aria-modal="true" aria-labelledby="dlg-title">
  <h2 id="dlg-title">Delete file?</h2>
</div>

aria-level

Values integer (1 or more)

The level of an element in a hierarchy: a role="heading" (where it is required; browsers usually treat a missing level as 2), a tree item, or a row in a treegrid. For headings, an h1–h6 element is better than role="heading" with aria-level.

Example
<div role="heading" aria-level="2">Shipping</div>

aria-orientation

Values horizontalverticalundefined

Whether a slider, scrollbar, separator, listbox, menu, tablist, toolbar or similar runs horizontally or vertically, which tells people which arrow keys move through it. Set it when it differs from the role’s default.

Example
<div role="tablist" aria-orientation="vertical" aria-label="Settings">
  …
</div>

aria-sort

Values ascendingdescendingnoneother

Says which way a table or grid is sorted by this column header. Put it on only the header currently sorted, and keep a button inside the header to change the order.

Example
<th aria-sort="ascending">
  <button type="button">Price</button>
</th>

Relationships

12 entries

aria-controls

Values ID reference list

Points to the element a control changes, such as the panel of a tab or a disclosure, or the listbox of a combobox. Few screen readers do anything with it, so it doesn’t replace aria-expanded or a clear name.

Example
<button type="button" aria-expanded="true" aria-controls="filters">
  Filters
</button>
<div id="filters">…</div>

aria-owns

Values ID reference list

Makes elements elsewhere in the DOM children of this one in the accessibility tree, such as a popup rendered at the end of the body. Use it only when you can’t move the elements in the DOM, and never for elements that are already its descendants.

Example
<div role="menuitem" aria-haspopup="menu" aria-expanded="false"
  aria-owns="more-menu" tabindex="-1">More</div>
<div id="more-menu" role="menu">…</div>

aria-activedescendant

Values ID reference

Points to the active option or item inside a composite widget while keyboard focus stays on the widget itself, as in a combobox whose input keeps focus while arrow keys move through suggestions. Update it on every move and draw the highlight from it.

Example
<input role="combobox" aria-label="City" aria-expanded="true" aria-controls="list"
  aria-activedescendant="opt-2">
<ul id="list" role="listbox">…</ul>

aria-flowto

Values ID reference list

Suggests an alternative reading order, pointing to the element to read next. Few screen readers support it; put the content in the right order in the DOM instead.

Example
<div id="step-1" aria-flowto="step-2">…</div>
<div id="step-2">…</div>
Related
aria-owns

aria-rowcount

Values integer (-1 if unknown)

The total number of rows in a table, grid or treegrid when only some are in the DOM, as with paging or lazy loading. Use -1 when the total is unknown.

Example
<table aria-rowcount="500">
  <tr aria-rowindex="41">…</tr>
</table>

aria-rowindex

Values integer (1 or more)

A row’s or cell’s position, counted from 1, in a table, grid or treegrid where not every row is in the DOM. Pair it with aria-rowcount.

Example
<div role="row" aria-rowindex="41">
  <div role="gridcell">Order 41</div>
</div>

aria-rowspan

Values integer (0 or more)

How many rows a cell spans in an ARIA table or grid built from divs. A native td or th uses its rowspan attribute instead.

Example
<div role="rowheader" aria-rowspan="3">Morning</div>

aria-colcount

Values integer (-1 if unknown)

The total number of columns in a table or grid when only some of them are in the DOM, such as a virtualised grid. Use -1 when the total is unknown.

Example
<div role="grid" aria-colcount="24" aria-label="Schedule">
  …
</div>

aria-colindex

Values integer (1 or more)

A cell’s or row’s column position, counted from 1, in a table or grid where not every column is in the DOM. Pair it with aria-colcount.

Example
<div role="row">
  <div role="gridcell" aria-colindex="7">Room 4</div>
</div>

aria-colspan

Values integer (1 or more)

How many columns a cell spans in an ARIA table or grid built from divs. A native td or th uses its colspan attribute instead.

Example
<div role="cell" aria-colspan="2">Total</div>

Live regions

4 entries

aria-live

Values offpoliteassertive

Makes an element a live region whose changes screen readers announce: polite waits until they finish speaking, assertive may interrupt. The region must be in the page before its text changes; use polite or role="status" for most messages.

Example
<div aria-live="polite"></div>
<!-- later, from script: -->
<!-- region.textContent = "Saved"; -->

aria-atomic

Values truefalse

Whether a screen reader reads the whole live region when part of it changes (true) or only the changed part (false, the default). role="status" and role="alert" already set it to true, so you rarely write it: add it to a bare aria-live region whose change only makes sense with the rest, such as “3 items in your basket”.

Example
<p aria-live="polite" aria-atomic="true">
  <span id="count">3</span> items in your basket
</p>

aria-relevant

Values additionsremovalstextall (space-separated)

Which changes in a live region are announced; the default is additions text. Removals are rarely useful and poorly supported, so leave the default unless items leaving matters, as in a chat roster.

Example
<ul aria-live="polite" aria-relevant="additions removals"
  aria-label="People in this chat">…</ul>

Other global states and properties

3 entries

aria-hidden

Values truefalseundefined

Removes an element and everything inside it from the accessibility tree while it stays on screen, for decorative icons or duplicated content. Never put aria-hidden="true" on focusable content or an ancestor of it, or keyboard users reach something screen readers can’t name.

Example
<button type="button">
  <svg aria-hidden="true">…</svg>
  Download
</button>
Go deeper
Compare: Hiding contentCompare: Removing meaning

aria-current

Values pagesteplocationdatetimetruefalse

Marks the current item in a set: the link to the page you are on, the current step of a process, today in a calendar. Use it rather than aria-selected for navigation, and show the same thing visually.

Example
<nav aria-label="Main">
  <a href="/shop" aria-current="page">Shop</a>
</nav>

aria-keyshortcuts

Values string (keys joined with +, shortcuts separated by spaces)

Tells assistive technology which keyboard shortcuts activate or focus an element, such as Control+S. It only describes them: your script must handle the keys, and the shortcut should be shown visually too.

Example
<button type="button" aria-keyshortcuts="Control+S">
  Save <kbd>Ctrl+S</kbd>
</button>

Sources