Skip to main content

ARIA Attributes: The Basics

Updated over 2 weeks ago

What are attributes?

Many programming languages use attributes to add information to their elements, such as specific properties or metadata.

Some examples:

  • HTML: <img src="image.jpg" alt="A descriptive text" width="200" height="150">
    Attributes used > src , alt, width, height

  • CSS:
    /* Targets disabled buttons */
    button[disabled] { background-color: grey; cursor: not-allowed; }
    Attributes used: background-color and cursor

What are ARIA attributes?

ARIA (Accessible Rich Internet Applications) attributes are specialized HTML attributes created to enhance the accessibility of web applications, particularly for users relying on assistive technologies like screen readers. These attributes provide additional information about elements, roles, states, and properties not inherently conveyed by standard HTML.

You should not create custom ARIA attributes.

Check out our Valid ARIA Attributes Quick Reference to see all defined attribute names.

Types of ARIA Attributes

ARIA attributes fall into three main categories:

  • Roles - used to define the type or purpose of an element (e.g., role="button", role="dialog")

  • States - dynamic properties, such as selected, checked, or disabled, whose value may be changed by users or application events. (e.g., aria-expanded="true" or "false").

  • Properties - provide information about the nature of an element, such as its name, orientation, or position in a set. Properties are less likely to change than states. (e.g., aria-labelledby="id")

Some Common ARIA Attributes

  • aria-hidden – hides an element from assistive tech

  • aria-label – gives an element an accessible

  • aria-labelledby – labels an element by referencing another element

  • aria-describedby – gives additional descriptive text for an element

  • aria-expanded – can provide assistive tech information on an element's state (like a dropdown), like expanded or collapsed


Learn More

DubBot Flags:

  • Ensure attributes that begin with aria- are valid ARIA attributes

  • Certain ARIA roles must contain particular children
    Ensures elements with an ARIA role that require child roles contain them​

  • Certain ARIA roles must be contained by particular parents
    Ensures elements with an ARIA role that require parent roles are contained by them

If you have questions, please contact our DubBot Support team via email at help@dubbot.com or via the blue chat bubble in the lower right corner of your screen. We are here to help!

Did this answer your question?