Which accessible name wins?
Accessible Name Wars: paste HTML and follow the label the browser chooses.
Up to 4 KB. Your markup is parsed, never rendered. Scripts and resources in it do not run or load. Only Copy link puts HTML in the URL; links are not encrypted.
The name is "Search"
Roughly announced as: Search, search text field.
Exact wording, role exposure, state announcements, and order vary by browser and screen reader.
Show selected element as source
<input id="q" type="search" aria-label="Search" placeholder="Type a selector" title="Search tools">Which source wins?
2A: hiddenSkipped
This node is not hidden by the supported markup rules.
2B:
aria-labelledbySkippedThere is no
aria-labelledbyreference.2C: embedded controlSkipped
This node is not a value-bearing control embedded in another label.
2D:
aria-labelUsedaria-labelsupplies "Search".2E:
label[for]Not reachedThe
aria-labelstep already determined the result.2F: contentNot reached
The
aria-labelstep already determined the result.2H: recursive contentNot reached
The
aria-labelstep already determined the result.2I: titleNot reached
The
aria-labelstep already determined the result.2E: placeholderNot reached
The
aria-labelstep already determined the result.2E:
aria-placeholderNot reachedThe
aria-labelstep already determined the result.
Description
Search tools
Show description computation
description-1:
aria-describedbySkippedThere are no valid
aria-describedbyreferences.description-2:
aria-descriptionSkippedThere is no
aria-description.description-3: native descriptionSkipped
There is no unused native description source.
description-4: titleUsed
title supplies "Search tools".
Checks and fixes
The visible label "Search the lab" is not contained in the name "Search".
Keep the visible wording in the accessible name, preferably at the start; verify symbolic text and visual context manually.
<button aria-label="Search the lab">Search</button>
Explainer
A label, not everything on screen
An accessible name identifies an element; a description adds context. A screen reader can combine the name with its role and state. The wording depends on the reader and platform, not just the HTML. See the accessible name specification.
Follow the order, then the exceptions
For an element that permits naming, aria-labelledby is checked before
aria-label, followed by native labels such as label, alt,
legend, and caption. Roles such as button and link can then use their
content. A title can be a fallback; supported text fields can finally use a placeholder.
An empty naming source can fall through, except where the element-specific rules say otherwise. Read the computation steps and
HTML's element-specific rules.
A hidden element is normally excluded, but a directly referenced hidden label can contribute its hidden subtree. A control embedded in another label contributes its value. A generic container cannot simply be given a name with ARIA. These are algorithm rules, not a universal attribute ranking. See hidden labels, embedded controls, and roles that prohibit naming.
Keep what people see in what they hear
A competing ARIA label can replace a perfectly useful visible label. Voice-control users need the visible wording in the accessible name. Case and ordinary punctuation do not have to match. Symbolic characters and surrounding visual context need human review. See WCAG 2.5.3: Label in Name .
Names and descriptions have different rules
Descriptions check aria-describedby, then aria-description, unused native
description sources, and finally an unused title. The first applicable description source
wins even if it is empty. A figcaption does not automatically name its
figure; reference it explicitly when appropriate. See description precedence
and figure naming
.
What pasted HTML cannot tell us
This tool reads attributes and text, not the rendered page. It recognizes hidden,
aria-hidden="true", and inline hiding styles. It cannot know class-based styling,
generated text, layout-dependent whitespace, shadow-tree changes, or values changed by scripts.
Browser-generated button labels are shown in English and can be localized by a real browser. Always
verify the final page with your browser and assistive technology. See rendered and generated content.