WebAIM - Web Accessibility In Mind

E-mail List Archives

Re: Can aria-labelledby refer to a label?

for

From: Jared Smith
Date: Jul 2, 2013 2:50PM


This should work just fine. The only 'gotcha' you need to be aware of
is when an element has an associated label element AND an
aria-labelledby attribute. In this case, the ARIA label will be read
and the associated label ignored.

This is usually the case when you have native HTML roles or
accessibility values and ARIA roles/values - ARIA will always override
the native semantics and accessibility. I've seen cases where someone
used a native <label> element for a primary label and also
aria-labelledby (or aria-label) to reference a secondary label or
instructions. This just results in the primary label being overridden
by the secondary label. The solution - keep the <label> as a fall-back
for older technologies, but have aria-labelledby reference both the
primary and secondary labels (or better, use aria-describedby for the
secondary label).

Jared