edubun
English
1 / 19

6 / 6 · Intermediate

Screen readers and the first rule of ARIA

The first rule of ARIA is to avoid it: if a native HTML element already does the job, such as button, use that instead of adding a role to a div.

Jump to the 10 practice questions

You will learn

  • See a page as roles, names and states
  • Prefer native HTML over ARIA
  • Name an icon button and hide decorative icons

Before this: Form labels

1Explain

The accessibility tree

A button can be announced as a button even when its colour is not visible. A screen reader does not read pixels. The browser builds an accessibility tree from the HTML. It is a simplified copy of the page in which every element of interest has a role (button, link, heading, checkbox), a name (the text that identifies it) and sometimes a state (checked, expanded, disabled).

A round button with an X inside. Sighted users guess it closes something; a screen reader needs the role and the name to say "Close, button".

2Problem

What is read

What does a screen reader actually read?

Hint

Not the pixels.

Solution

Answer: The accessibility tree built from the HTML

Roles, names and states come from the HTML and ARIA.

3Problem

Name, role, value

Which three things does 4.1.2 ask every control to expose?

Hint

Criterion 4.1.2.

Solution

Answer: Name, role, value

Name, Role, Value, level A.

4Explore

How people listen

Users rarely listen to a page from top to bottom. Screen readers are built into the major operating systems, and free ones can also be installed. They let people pull up a list of headings, links or landmarks, jump to the next form field, or read one line at a time. That is why the earlier units matter so much: real headings, labelled fields, buttons that are buttons and alt text all feed directly into that tree. The lang attribute on the html element matters too.

Each line has a role and a name. Screen reader users jump through lists like this instead of listening from the top.

Your code
<header><nav><a href="/">Home</a> <a href="/menu">Menu</a></nav></header>
<main>
  <h1>Corner Bakery</h1>
  <h2>Bread</h2>
  <ul><li>Sourdough</li><li>Rye</li></ul>
  <button>Order</button>
</main>
Preview
What a screen reader announces (simplified)

    5Problem

    Moving through a page

    Screen reader users most often move through a page by

    Hint

    They pull up lists.

    Solution

    Answer: lists of headings, links and landmarks

    Screen readers offer lists to jump through, which is why structure matters.

    6Explain

    What ARIA does

    WAI-ARIA (Accessible Rich Internet Applications) is a set of attributes that change what goes into the accessibility tree. role sets the role, attributes such as aria-label set the name, and ones such as aria-checked or aria-expanded set the state. ARIA changes only what is announced. It does not make an element focusable, does not add keyboard behaviour and does not change how it looks. The W3C ARIA Authoring Practices Guide puts it in a heading: "No ARIA is better than bad ARIA".

    7Problem

    Does ARIA change the look?

    Does ARIA change how an element looks?

    Hint

    Looks come from CSS.

    Solution

    Answer: No, only what is announced

    Looks come from CSS; behaviour from HTML or scripts.

    8Explore

    The first rule

    The W3C document Using ARIA sets out short rules that are quoted everywhere (it was marked as a discontinued draft in February 2026, but the rules themselves have not changed). Rule 1: if you can use a native HTML element or attribute with the meaning and behaviour you need already built in, do so, instead of repurposing another element with ARIA. Rule 2: do not change native semantics unless you really have to. Rule 3: every interactive ARIA control must be usable with the keyboard.

    Both are announced as checkboxes, but only the real input can be reached with Tab and ticked with Space.

    Your code
    <span role="checkbox" aria-checked="false">Send me the weekly menu</span>
    <label><input type="checkbox"> Send me the weekly menu</label>
    Preview
    What a screen reader announces (simplified)

      9Problem

      Rule 1

      What is the first rule of ARIA use?

      Hint

      Native elements come with keyboard support.

      Solution

      Answer: Use a native HTML element if it already does the job

      Native elements come with role, name handling and keyboard support.

      10Problem

      role="button" on a span

      You add role="button" to a span. What do you still have to add yourself?

      Hint

      ARIA changes only what is announced.

      Solution

      Answer: Focus and Enter/Space handling

      ARIA changes the announcement only; rule 3 says it must work from the keyboard.

      11Problem

      Bad ARIA

      Which heading appears in the W3C Authoring Practices Guide?

      Hint

      Wrong information is worse than none.

      Solution

      Answer: No ARIA is better than bad ARIA

      Wrong ARIA gives false information to screen reader users.

      12Explore

      Where ARIA helps

      Where ARIA does help is in filling gaps HTML cannot. A button that contains only an icon has no text, so it has no name; aria-label="Close" gives it one. An SVG icon next to visible text is decoration, and aria-hidden="true" on the svg keeps it out of the tree. Those are the two attributes most beginners need. For whole widgets such as tabs or menus, follow the matching pattern in the Authoring Practices Guide rather than inventing one.

      An icon-only button has no name until aria-label gives it one. aria-hidden keeps a decorative icon out of the list.

      Your code
      <button><svg width="16" height="16" viewBox="0 0 16 16"><path d="M2 2 L14 14 M14 2 L2 14" stroke="black" stroke-width="2"/></svg></button>
      <button aria-label="Close"><svg width="16" height="16" viewBox="0 0 16 16"><path d="M2 2 L14 14 M14 2 L2 14" stroke="black" stroke-width="2"/></svg></button>
      <button><svg aria-hidden="true" width="16" height="16"></svg> Print</button>
      Preview
      What a screen reader announces (simplified)

        13Problem

        Naming an icon button

        Which ARIA attribute gives an icon-only button a name?

        Hint

        aria- plus a word.

        Solution

        Answer: aria-label

        aria-label supplies the name, for example aria-label="Close". It tells the listener what the icon-only button does, but does not add keyboard behaviour.

        14Problem

        Never aria-hidden here

        Where must aria-hidden="true" never go?

        Hint

        Something you can focus but not hear.

        Solution

        Answer: On an element that can receive focus

        Rule 4: users would focus on something the screen reader cannot describe.

        15Problem

        The lang attribute

        What does the lang attribute on html help a screen reader do?

        Hint

        Voices and pronunciation.

        Solution

        Answer: Choose the right voice and pronunciation

        The lang attribute declares the page language, as criterion 3.1.1 requires. A screen reader uses it to choose suitable pronunciation rather than guessing from the page’s appearance.

        16Practice

        Name the close button

        The close button contains only an icon, so it has no name. Give the button aria-label="Close" and hide the decorative svg with aria-hidden="true".

        Checks
        • button named Close
        • svg hidden
        Your code
        <div class="dialog">
          <button class="close">
            <svg width="16" height="16" viewBox="0 0 16 16"><path d="M2 2 L14 14 M14 2 L2 14" stroke="black" stroke-width="2"/></svg>
          </button>
          <p>Your order is ready.</p>
        </div>
        Preview
        Hint

        Two attributes: aria-label on the button, aria-hidden on the svg.

        A solution
        <div class="dialog">
          <button class="close" aria-label="Close">
            <svg aria-hidden="true" width="16" height="16" viewBox="0 0 16 16"><path d="M2 2 L14 14 M14 2 L2 14" stroke="black" stroke-width="2"/></svg>
          </button>
          <p>Your order is ready.</p>
        </div>

        17Practice

        A native checkbox

        This checkbox is a span with ARIA and no keyboard support. Apply the first rule: replace it with <input type="checkbox" id="news"> and a label for it with the same text, and remove the span.

        Checks
        • a real checkbox
        • label tied to it
        • ARIA span removed
        Your code
        <form>
          <span role="checkbox" aria-checked="false" onclick="this.setAttribute('aria-checked', this.getAttribute('aria-checked') === 'true' ? 'false' : 'true')">Send me the weekly menu</span>
        </form>
        Preview
        Hint

        Replace the whole span with an input and a label.

        A solution
        <form>
          <input type="checkbox" id="news">
          <label for="news">Send me the weekly menu</label>
        </form>

        18Explain

        Common mistakes

        Mistake
        <button aria-hidden="true">Order</button>
        Fixed
        <button>Order</button>

        aria-hidden on something that can take focus leaves keyboard users on a control the screen reader cannot describe.

        19

        Summary

        • Screen readers read the accessibility tree: role, name, state.
        • ARIA changes what is announced, not behaviour or focus.
        • Rule 1: use native HTML first. No ARIA is better than bad ARIA.
        • aria-label names icon buttons; aria-hidden hides decoration.

        Back to the courseWeb accessibility
        Full text · The whole lesson as one text

        What a screen reader works from

        A button can be announced as a button even when its colour is not visible. A screen reader does not read pixels. The browser builds an accessibility tree from the HTML. It is a simplified copy of the page in which every element of interest has a role (button, link, heading, checkbox), a name (the text that identifies it) and sometimes a state (checked, expanded, disabled). The screen reader reads that tree aloud or sends it to a braille display. WCAG 2.2 success criterion 4.1.2 Name, Role, Value, at level A, asks that every control on the page exposes these three things.

        A round button with an X inside. Sighted users guess it closes something; a screen reader needs the role and the name to say "Close, button".

        Users rarely listen to a page from top to bottom. Screen readers are built into the major operating systems, and free ones can also be installed. They let people pull up a list of headings, links or landmarks, jump to the next form field, or read one line at a time. That is why the earlier units matter so much: real headings, labelled fields, buttons that are buttons and alt text all feed directly into that tree. The lang attribute on the html element matters too. Criterion 3.1.1 Language of Page asks for it, and screen readers use it to choose the right voice and pronunciation.

        What ARIA adds

        WAI-ARIA (Accessible Rich Internet Applications) is a set of attributes that change what goes into the accessibility tree. role sets the role, attributes such as aria-label set the name, and ones such as aria-checked or aria-expanded set the state. ARIA changes only what is announced. It does not make an element focusable, does not add keyboard behaviour and does not change how it looks. The W3C ARIA Authoring Practices Guide puts it in a heading: "No ARIA is better than bad ARIA". Wrong ARIA tells a screen reader user something false about the page.

        The rules of ARIA use

        The W3C document Using ARIA sets out short rules that are quoted everywhere (it was marked as a discontinued draft in February 2026, but the rules themselves have not changed). Rule 1: if you can use a native HTML element or attribute with the meaning and behaviour you need already built in, do so, instead of repurposing another element with ARIA. Rule 2: do not change native semantics unless you really have to. Rule 3: every interactive ARIA control must be usable with the keyboard. Rule 4: do not put role="presentation" or aria-hidden="true" on an element that can receive focus, or some users will land on "nothing".

        Where ARIA does help is in filling gaps HTML cannot. A button that contains only an icon has no text, so it has no name; aria-label="Close" gives it one. An SVG icon next to visible text is decoration, and aria-hidden="true" on the svg keeps it out of the tree. Those are the two attributes most beginners need. For whole widgets such as tabs or menus, follow the matching pattern in the Authoring Practices Guide rather than inventing one.

        Key points
        • Screen readers read the accessibility tree: role, name, state.
        • ARIA changes what is announced, not behaviour or focus.
        • Rule 1: use native HTML first. No ARIA is better than bad ARIA.
        • aria-label names icon buttons; aria-hidden hides decoration.

        Inspect a control in the browser’s accessibility panel, then test it with the keyboard. A correct name in the tree answers what the control is called; it does not prove that the control can be reached or operated. If an icon button is announced correctly but cannot receive focus, adding another label will not fix the problem. Return to the native element and keyboard behaviour before adding more ARIA attributes.

        Practice questions from Screen readers and the first rule of ARIA on edubun

        Embed this quiz

        Free to embed. Please keep the credit line.

        Sources for this course (8)
        • W3C, Web Content Accessibility Guidelines (WCAG) 2.2, W3C Recommendation first published 5 October 2023, current edition 12 December 2024 (w3.org/TR/WCAG22/, checked 2026-10-17)
        • W3C WAI, What's new in WCAG 2.2 (w3.org/WAI/standards-guidelines/wcag/new-in-22/, checked 2026-10-17)
        • W3C WAI, Images tutorial and alt decision tree (w3.org/WAI/tutorials/images/decision-tree/, checked 2026-10-17)
        • W3C, Using ARIA (w3.org/TR/using-aria/, Discontinued Draft 24 February 2026, rules 1 to 4, checked 2026-10-17)
        • W3C WAI-ARIA Authoring Practices Guide, Read Me First, "No ARIA is better than bad ARIA" (w3.org/WAI/ARIA/apg/practices/read-me-first/, checked 2026-10-17)
        • MDN Web Docs, tabindex (developer.mozilla.org/en-US/docs/Web/HTML/Reference/Global_attributes/tabindex, checked 2026-10-17)
        • MDN, Heading elements, accessibility notes (developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/Heading_Elements, checked 2026-10-17)
        • MDN, autocomplete attribute (developer.mozilla.org/en-US/docs/Web/HTML/Reference/Attributes/autocomplete, checked 2026-10-17).

        Checked: 2026-10-17