Please note, this is a STATIC archive of website developer.mozilla.org from November 2016, cach3.com does not collect or store any user information, there is no "phishing" involved.

Using the aria-describedby attribute

Description

The aria-describedby attribute is used to indicate the IDs of the elements that describe the object. It is used to establish a relationship between widgets or groups and text that described them. This is very similar to aria-labelledby: a label describes the essence of an object, while a description provides more information that the user might need.

The aria-describedby attribute is not used only for form elements; it is also used to associate static text with widgets, groups of elements, panes, regions that have a heading, definitions, and more. The Examples section below provides more information about how to use the attribute in these cases.

This attribute can be used with any typical HTML form element; it is not limited to elements that have an ARIA role assigned.

Value

a space-separated list of element IDs

Possible effects on user agents and assistive technology 

 

Note: Opinons may differ on how assistive technology should handle this technique. The information provided above is one of those opinions and therefore not normative.

Examples

Example 1: Application Landmark Descriptions

In the example below, an introductory paragraph describes a calendar application. aria-describedby is used to associate the paragraph with the application container.

<div role="applicaton" aria-labelledby="calendar" aria-describedby="info">
    <h1 id="calendar">Calendar<h1>
    <p id="info">
        This calendar shows the game schedule for the Boston Red Sox.
    </p>
    <div role="grid">
        ...
    </div>
</div>

Example 2: A Close Button

In the example below, a link that functions as a 'close' button on a dialog is described elsewhere in the document. The aria-describedby attribute is used to associate the description with the link.

<button aria-label="Close" aria-describedby="descriptionClose" 
    onclick="myDialog.close()">X</button>

...

<div id="descriptionClose">Closing this window will discard any information entered and 
return you back to the main page</div>

Working Examples:

Notes 

  • The aria-describedby attributed is not designed to reference descriptions on an external resource—since it is an ID, it must reference an element in the same DOM document.

Used by ARIA roles

all elements of the base markup

Compatibility

TBD: Add support information for common UA and AT product combinations

Additional resources

Document Tags and Contributors

 Contributors to this page: rosay, smarvin, Fredchat, Sheppy, dluna, Jeremie, anastasia
 Last updated by: rosay,