Content · Web Development · HTML

HTML Accessible Name Computation: Visible Labels vs ARIA

Accessible Name Computation: Visible Labels vs ARIA: Visible labels usually provide the best input names; aria-labelledby can name a region using visible heading text. Includes a practical HTML example and an explanation.

1 views Published Oct 19, 2026 Updated Oct 19, 2026 Admin

Not everyone uses a mouse to explore a website. Good HTML must also make sense through a keyboard or screen reader.

What You Need to Know


A control's accessible name may come from its text, a label, aria-labelledby, or aria-label. Those sources can compete. Prefer visible words that match the name announced to someone using a screen reader.

Try the Example


Take a look at the example. We’ll explain the important lines right below it.

<h2 id="newsletter-heading">Join the newsletter</h2>
<form aria-labelledby="newsletter-heading" action="/subscribe" method="post">
    <label for="subscriber-email">Email</label>
    <input id="subscriber-email" name="email" type="email">
    <button type="submit">Subscribe</button>
</form>

Let’s Read the Code


  • name: The name is the key used for the submitted value.
  • <h2>: A heading divides the page into understandable parts.
  • <form>: The form groups controls and identifies where submitted data goes.
  • id: An id uniquely identifies an element on this page.

What the example shows: Visible labels usually provide the best input names; aria-labelledby can name a region using visible heading text.

What Happens in the Browser?


Try this with Tab and Shift+Tab. If you can, inspect the accessibility tree too; appearance alone does not tell the whole story.

What does assistive technology receive? The example includes aria-labelledby. These relationships can explain names, states, or descriptions when used correctly. They do not automatically move focus, listen for clicks, or create keyboard handling.

Your Turn


Move through the example without a mouse. Read each control name and current state aloud as if describing it to a friend.

Common Beginner Mistakes


  • Expecting ARIA alone to create keyboard behavior or make a control interactive.
  • Do not provide two conflicting accessible names for the same control.

Key Takeaways


  • A control's accessible name may come from its text, a label, aria-labelledby, or aria-label.
  • name: The name is the key used for the submitted value.
  • A meaningful HTML element is usually a stronger starting point than adding an ARIA role to a generic div. Also check what happens using only the keyboard.
Share this resourceSend this page to someone who may find it useful.