While a label element refers to the thing it labels, the relationship is reversed in the case of aria-labelledby - the thing being labeled refers to the thing that labels it. aria-labelledby may be used on any element, not just labelable elements.This is much like using a label element, with some key differences. aria-labelledby #Īria-labelledby allows us to specify the ID of another element in the DOM as an element's label. You might use an aria-label attribute when you have some kind of visual indication of an element's purpose, such as a button that uses a graphic instead of text, but still need to clarify that purpose for anyone who cannot access the visual indication, such as a button that uses only an image to indicate its purpose. This overrides any other native labeling mechanism, such as a label element - for example, if a button has both text content and an aria-label, only the aria-label value will be used. aria-label #Īria-label allows us to specify a string to be used as the accessible label. Let's look at the properties ARIA uses to create accessible labels. In fact, ARIA is the only way to add accessible help or description text. ARIA provides several mechanisms for adding labels and descriptions to elements.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |