Léonie Watson (@LeonieWatson) explains the difference between aria-label
and aria-labelledby
:
The
aria-label
andaria-labelledby
attributes are both used to give an element it’s accessible name. The difference betweenaria-label
andaria-labelledby
is where they get that piece of text, and the clue is in the name. Thearia-label
attribute gives an element its label; an element with thearia-labelledby
attribute is labelled by something else.
But don’t go adding of them everywhere, as you might not need ARIA (see The First Rule of ARIA) 😉