PHPnews.io

The difference between aria-label and aria-labelledby

Written by Bram.us / Original link on Sep. 7, 2020

accessibilit-a11y.png

Léonie Watson (@LeonieWatson) explains the difference between aria-label and aria-labelledby:

The aria-label and aria-labelledby attributes are both used to give an element it’s accessible name. The difference between aria-label and aria-labelledby is where they get that piece of text, and the clue is in the name. The aria-label attribute gives an element its label; an element with the aria-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) 😉

The difference between aria-label and aria-labelledby

bram a11y bram link bram

« How Static Methods Kill You Like Corona - CSS Vocabulary »