Skip to content

Commit

Permalink
WAI-ARIA: Improve paragraph about aria-labelledby
Browse files Browse the repository at this point in the history
  • Loading branch information
softy-dev committed Oct 26, 2024
1 parent 0124936 commit 6e14933
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion advanced_html_css/accessibility/wai_aria.md
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ Once a screen reader reaches the above HTML, it would announce "Main navigation,

#### aria-labelledby

The `aria-labelledby` attribute overrides both the native label and the `aria-label` attribute. `aria-labelledby` changes an element's accessible name (created by `aria-labelledby`) to a concatenated string of the text contents or `alt` attributes of the labeling elements (the ones whose `id` are passed in).
The `aria-labelledby` attribute overrides both the native label and the `aria-label` attribute. When you use `aria-labelledby`, the accessible name of the target element is created by concatenating the text contents or `alt` attributes of the elements whose `id` are referenced.

The great thing about `aria-labelledby` is that not only can you pass in any number of `id` references, but you can also have an element reference itself. Keep in mind that you can't pass in the same reference multiple times, because any subsequent references after the first will be ignored.

Expand Down

0 comments on commit 6e14933

Please sign in to comment.