The Accessible Name Computation, Demystified
How the browser decides what an element is called.
The Accessible Name Computation, Demystified is a free Web Accessibility Academy lesson on CoddyKit — lesson 1 of 4. You can read the complete lesson below for free — then practise it hands-on in the browser with a built-in code editor and a 24/7 AI tutor. It is part of the Web Accessibility Academy learning path, one of 4 lessons in the course, and your progress syncs across the web and the CoddyKit app.
What Is an Accessible Name?
The accessible name is the short label a screen reader speaks for an element, like Submit for a button or Search for a field.
Why It Matters
If an element has no accessible name, a screen reader announces just its role, like button, leaving users with no idea what it does.
The Browser Computes It
You rarely set the name directly. The browser runs a name computation algorithm over your markup to decide what each element is called.
It Follows an Order
The algorithm checks sources in a fixed priority order and uses the first one it finds. Knowing that order lets you predict the result.
aria-labelledby Wins First
The highest priority is aria-labelledby. If present, it overrides every other source, gathering text from the elements it points to.
<button aria-labelledby="t">x</button>
<span id="t">Close menu</span>aria-label Comes Next
If there is no labelledby, the browser uses aria-label, a string you type directly on the element as its spoken name.
<button aria-label="Close">x</button>Then Native Labeling
Next come native sources, like a label tied to an input, or the alt text of an image. Use these whenever you can.
<label for="email">Email</label>
<input id="email">Then the Content Itself
For many elements the name falls back to their text content. A button reading Save is named Save without any extra attribute.
<button>Save</button>title Is the Last Resort
The lowest priority source is the title attribute. It only names an element when nothing better exists, and it is easy to miss.
Names Get Trimmed
The computed name is flattened into one string with extra whitespace collapsed, so line breaks and indentation never reach the user.
Name vs Description
The name is what an element is called; a description is extra detail read after it. Today we focus on getting the name right.
Quick Check
An element has both aria-label and inner text. Which becomes its name?
Recap: How Names Are Built
You learned the name computation order: labelledby, then aria-label, then native labels and content, with title last. 🧩
Frequently asked questions
Is the “The Accessible Name Computation, Demystified” lesson free?
Yes — the full text of “The Accessible Name Computation, Demystified” is free to read here on the web, and the Web Accessibility Academy course includes 4 lessons in total. To practise it interactively (a built-in code editor and a 24/7 AI tutor) and unlock the rest of the Web Accessibility Academy course, upgrade to CoddyKit PRO.
What will I learn in “The Accessible Name Computation, Demystified”?
How the browser decides what an element is called. You practise Web Accessibility Academy with hands-on code you run directly in the browser, and a 24/7 AI tutor answers your questions as you work through the lesson.
Do I need any experience to start Web Accessibility Academy?
No prior experience is required. Web Accessibility Academy on CoddyKit is structured for beginners through advanced learners; this is — lesson 1 of 4, so you can start here or from the beginning and move at your own pace.
How long does the “The Accessible Name Computation, Demystified” lesson take?
Most CoddyKit lessons take about 5–10 minutes. Each one is bite-sized and interactive, so you make steady progress and pick up exactly where you left off across the web and the app.
Can I write and run code in this Web Accessibility Academy lesson?
Yes. Every Web Accessibility Academy lesson includes a built-in code editor, so you write and run real code right in your browser and get instant AI feedback — no local setup required.
All lessons in this course
- The Accessible Name Computation, Demystified
- aria-label vs aria-labelledby
- aria-describedby for Extra Context
- Common Naming Mistakes That Silence Controls