Accessible Name Calculation
Last updated: 7 October 2023
Just a cheat sheet.
Although the title-attribute is mentioned here, it is better not to use it.
Algorithm for names
aria-labelledby
aria-label
<label>
(for form controls)placeholder
(for text form controls)figcaption
(for figure elements)alt
(for img or area elements)<caption>
(for table elements)<legend>
(for fieldset elements)- text contents (if exists in this role)
value
(for input form controls with type of button, submit, or reset)title
badly supported by broswers and screenreaders
Algorithm for descritions
aria-describedby
title
placeholder
(for a text form control)
<input>
aria-labelledby
aria-label
- geassocieerde
<label>
placeholder
(only when text input involved)title
- no accessible name
button
except type=submit
and type=reset
aria-labelledby
aria-label
value
(not for button-element)title
- no accessible name
<a href
aria-labelledby
aria-label
- subtree of
<a>
title
summary
- no accessible name
input type="image"
aria-labelledby
aria-label
alt
value
- named by user agent in case of "Submit Query"
title
- no accessible name
<img>
aria-labelledby
aria-label
alt
title
- no accessible name
<table>
aria-labelledby
aria-label
<caption>
title
summary
- no accessible name
What's my name?
<bla role="button" aria-label="name1" aria-labelledby="name2">
<span id="name2">Name3</span>
<div id="content">
Name4
</div>
</bla>