There's a faster version of egghead. Click here to try it.
1×
Become a member
to unlock all features

Create an egghead account to access 5000+ tutorials and resources from expert developers.

Create account
Autoplay

    Add an Accessible Label to an Element from the Text of Other Elements

    reactReact
    >=16.10.2

    Labeling inputs, elements, and widgets add context and clarity for assistive technology such as screen readers. When there are already one or more other elements that themselves can be used to provide labeling text to another element an aria-labelledby attribute can be added to that element.

    Some examples of appropriate use cases for using an aria-labelledby are:

    • Combine multiple labels together
    • Associate headings with regions
    • Label for a widget