EduFlow

Section 1 · Why Accessibility, and for Whom

How Assistive Technology Reads Your Page

17 min3 min readCode playground

Lesson at a glance

Explain how screen readers, magnifiers, switch access and voice control operate a page, and read the accessibility tree the browser builds for them.

  1. 1The accessibility tree
  2. 2Four ways people operate Ticketly
  3. 3Showing it to the tree, not the eye

No video here — just the real thing: a written lesson, runnable examples, a quiz and practice.

Open Ticketly with your screen turned off. That sounds like a stunt, but it is what Samir does every working day, and it is the fastest way to understand what your code really sends to the people using it. Before you fix anything, you need a clear picture of how assistive technology (AT) gets information out of a web page.

The accessibility tree

Assistive technologies don’t look at your pixels. The browser takes the DOM, combines it with CSS, and builds a second, simpler tree: the accessibility tree. Each node in it has a few properties:

  • a role: button, link, heading (level 2), textbox, checkbox, list, generic;
  • a name: the text that identifies it, such as “Book now”;
  • states and values: checked, expanded, disabled, the current text in an input.

The browser hands that tree to the operating system’s accessibility API, and the screen reader, magnifier or voice control software reads it from there.

The DOM and CSS feed the browser, which builds the accessibility tree; the tree is exposed through the operating system accessibility API to screen readers, magnifiers, switch and voice control software. DOM + CSS your code Accessibility tree role, name, state OS API UIA, AX, AT-SPI Screen reader Magnifier Voice, switch
From your markup to the user’s ears

Here is part of Ticketly’s event card, and what the tree contains for it:

ticketly/index.html
<h3>Harbour Lights: Friday</h3>
<div class="btn" onclick="book('fri')">Book now</div>
<button type="button" onclick="book('sat')">Book now</button>
Text
heading "Harbour Lights: Friday" (level 3)
generic
  text "Book now"
button "Book now"

The div shows the same text, but its role is generic. A screen reader reads “Book now” as a sentence, with no hint that it does anything, and it can’t be reached with the Tab key. You can inspect this yourself: in Chrome or Edge DevTools, select an element and open the Accessibility pane; Firefox has a dedicated Accessibility Inspector tab.

Four ways people operate Ticketly

Screen readers (NVDA and JAWS on Windows, VoiceOver on Apple devices, TalkBack on Android) turn the tree into speech or braille. Users rarely listen to a page top to bottom. In WebAIM’s 2026 survey, 67.8% of screen reader users said their first move on a long page is to jump between headings. They also pull up lists of links, landmarks and form fields. Your structure is their table of contents.

Screen magnifiers (Windows Magnifier, macOS Zoom, ZoomText) enlarge a small region that follows the focus or pointer. Maha, a designer on my team, works at 400%: she sees about a sixteenth of the screen at once. Anything that happens far from her focus, like a toast in the opposite corner, didn’t happen as far as she is concerned.

Switch access users press one or two physical switches. The software steps through focusable elements, and a switch press activates the current one. If an element isn’t focusable, it can’t be reached at all. Switch users depend on the same keyboard operability you will build in Section 3.

Voice control (Voice Control on macOS and iOS, Dragon on Windows) lets people say “click Book now” or “show numbers”. The software matches spoken words against accessible names. When a button reads “Book seats” on screen but has aria-label="cta-primary", the words Dina says don’t match the name and nothing happens. WCAG calls this Label in Name: the accessible name must contain the visible text.

Showing it to the tree, not the eye

Two patterns cover most cases on Ticketly.

When a visual cue carries meaning that has no text, add text that only the tree sees. Ticketly marks a sold-out date with a strike-through and grey colour. A screen reader announces “SAR 180” and Samir happily tries to buy it. Add a visually-hidden note:

ticketly/styles.css
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}
HTML
<p class="price sold">SAR 180 <span class="visually-hidden">(sold out)</span></p>

When an element is decorative, hide it from the tree. Ticketly puts a small calendar icon before every date. Inline SVGs can be announced as “image” or “graphic”, which is noise. aria-hidden="true" removes them:

HTML
<p class="date"><svg class="icon" aria-hidden="true" viewBox="0 0 16 16">…</svg> 12 June, 8 pm</p>

The tree is the contract between your code and every AT. Next you will see the standard that defines what that contract must include: WCAG 2.2.

Key takeaways

  • Assistive technologies don’t read your pixels; they read the accessibility tree, where each node has a role, a name, and states or a value.
  • Screen reader users move by headings, landmarks, links and form fields, so structure is their table of contents.
  • Magnifier, switch and voice control users depend on visible focus, keyboard operability and visible labels that match accessible names.
  • display none, the hidden attribute and aria-hidden remove content from the tree; a visually-hidden class hides it from the eye but keeps it for screen readers.

Further reading

Check your understanding

4 questions

Question 1 of 4

A screen reader user reaches this element. What does the accessibility tree give the screen reader to announce?

HTML
<div class="btn" onclick="book()">Book now</div>
Question 2 of 4

Maha uses screen magnification at 400%, so she sees about a sixteenth of the page at a time. Ticketly shows “Added to basket” in a toast at the top-right corner while she is clicking a button bottom-left. What is the main barrier?

Question 3 of 4

Dina controls her computer by voice. The button shows the text “Book seats” but has aria-label="cta-primary". What happens when she says “click Book seats”?

Question 4 of 4

Which CSS hides a “Sold out” note from sighted users but keeps it in the accessibility tree?

Practice

Code playground

Tell the tree what the eye sees

Ticketly’s Friday price (#fri-price) is struck through and greyed out because the date is sold out, but a screen reader only hears “SAR 180”. Meanwhile every decorative SVG icon can be announced as an unlabeled graphic.

  1. Add the words sold out to #fri-price so they reach the accessibility tree. You can show them, or hide them visually with a .visually-hidden class (not display: none).
  2. Hide all four decorative <svg> icons from assistive technology.
  3. Leave Saturday (#sat-price) available.
<h2>Harbour Lights dates</h2>
<article class="event">
  <h3>Friday</h3>
  <p class="date"><svg class="icon" viewBox="0 0 16 16"><rect x="1" y="3" width="14" height="12" rx="2"/></svg> 12 June, 8 pm</p>
  <p class="price sold" id="fri-price"><svg class="icon" viewBox="0 0 16 16"><circle cx="8" cy="8" r="7"/></svg> SAR 180</p>
</article>
<article class="event">
  <h3>Saturday</h3>
  <p class="date"><svg class="icon" viewBox="0 0 16 16"><rect x="1" y="3" width="14" height="12" rx="2"/></svg> 13 June, 8 pm</p>
  <p class="price" id="sat-price"><svg class="icon" viewBox="0 0 16 16"><circle cx="8" cy="8" r="7"/></svg> SAR 180</p>
</article>Loading the editor…

Ctrl/⌘ + Enter to run · Runs in a sandbox in your browser. Nothing leaves your device.

Preview

Console

(no output)

Checks

  • The Friday price contains the words “sold out”
  • The “sold out” text is not hidden from assistive technology
  • All four decorative icons are hidden with aria-hidden=“true”
  • Saturday still shows SAR 180 and is not marked sold out