Menu
×
   ❮     
HTML CSS JAVASCRIPT SQL PYTHON JAVA PHP C C++ C# AWS W3.CSS HOW TO BOOTSTRAP REACT MYSQL JQUERY EXCEL XML DJANGO NUMPY PANDAS NODEJS DSA TYPESCRIPT ANGULAR ANGULARJS GIT POSTGRESQL MONGODB ASP AI R GO KOTLIN SWIFT SASS VUE GEN AI SCIPY CYBERSECURITY DATA SCIENCE INTRO TO PROGRAMMING INTRO TO HTML & CSS BASH RUST TOOLS MATH

HTML Tutorial

HTML HOME HTML Introduction HTML Editors HTML Basic HTML Elements HTML Attributes HTML Headings HTML Paragraphs HTML Styles HTML Project I HTML Formatting HTML Quotations HTML Comments HTML Colors HTML CSS HTML Project II HTML Links HTML Images HTML Favicon HTML Page Title HTML Tables HTML Lists HTML Project III HTML Block & Inline HTML Div HTML Classes HTML Id HTML Project IV HTML Buttons HTML Iframes HTML JavaScript HTML File Paths HTML Head HTML Layout HTML Responsive HTML Project V HTML Computercode HTML Semantics HTML Project VI HTML Dialog HTML Style Guide HTML Entities HTML Symbols HTML Emojis HTML Charsets HTML URL Encode HTML vs. XHTML

HTML Forms

HTML Forms HTML Form Attributes HTML Form Elements HTML Input Types HTML Input Attributes Input Form Attributes HTML Project VII

HTML Graphics

HTML Canvas HTML SVG

HTML Media

HTML Media HTML Video HTML Audio HTML YouTube HTML Project VIII

Web Accessibility

Web Accessibility ARIA Attributes Keyboard Focus and tabindex Landmarks Skip Links Color Contrast

Web APIs

Web APIs Geolocation API Drag and Drop API Popover API Web Storage API Web Workers API Server-Sent Events API

HTML Cert

HTML Certificate

HTML Examples

HTML Examples HTML Videos HTML Editor HTML Quiz HTML Exercises HTML Challenges HTML Projects HTML Website HTML Syllabus HTML Study Plan HTML Interview Prep HTML Summary

HTML References

HTML Tag List HTML Attributes HTML Global Attributes HTML Browser Support HTML Event Attributes HTML Colors HTML Canvas HTML Audio/Video HTML Doctypes HTML Character Sets HTML URL Encode HTML Language Codes HTML Country Codes HTTP Status Codes HTTP Request Methods PX to EM Converter Keyboard Shortcuts

Web Accessibility - ARIA Attributes


Share

What is ARIA?

ARIA stands for Accessible Rich Internet Applications, and is a set of HTML attributes that give extra information to screen readers.

Note: ARIA does not change how a page looks. It only changes what assistive technology hears.


The First Rule of ARIA

First rule: Use a real HTML element whenever you can. A <button> already works with the keyboard and screen readers. A <div> with ARIA does not, unless you add a lot of extra code.

Example

<!-- Good -->
<button>Save</button>

<!-- Avoid -->
<div role="button">Save</div>

The aria-label Attribute

The aria-label attribute gives an element a name when there is no visible text. This is common for icon buttons:

Example

<button aria-label="Close">X</button>

A screen reader says "Close, button" instead of reading the X symbol.

If the name is already visible somewhere else on the page, use aria-labelledby to point to it:

Example

<h2 id="cartTitle">Shopping cart</h2>

<ul aria-labelledby="cartTitle">...</ul>


The role Attribute

The role attribute tells assistive technology what an element is.

Most HTML elements already have a built-in role, so you only need role when no HTML element fits:

Example

<div role="alert">Your session will end in 1 minute.</div>

The role attribute can have one of the following values:

  • alert - indicates an important message that is read out right away
  • status - indicates a less urgent message, like "Saved"
  • tab, tablist, tabpanel - indicates a set of tabs
  • img - indicates a group of elements that together form one image

The aria-live Attribute

When content changes without a page reload, screen readers may not notice!

The aria-live attribute tells them to read the change out loud:

Example

<p aria-live="polite" id="message"></p>

<script>
document.getElementById("message").textContent = "3 items added to your cart";
</script>

The aria-live attribute can have one of the following values:

  • polite - waits until the screen reader is done speaking. Use this most of the time.
  • assertive - interrupts right away. Use only for urgent messages, like errors.

Tip: The live element must already be on the page before the text changes, or the update may not be read.


Common ARIA Attributes

The following table lists some common ARIA attributes:

Attribute Description
aria-label Gives an element a name when there is no visible text
aria-labelledby Points to the id of another element to use as the name label
aria-describedby Points to the id of another element that provides extra description
aria-hidden="true" Hides decorative/non-essential elements from assistive technologies
aria-expanded="true|false" Indicates whether a collapsible section, dropdown, or accordion is open or closed
aria-live="polite|assertive" Announces dynamic content updates without moving user focus
aria-current="page|step|..." Marks the active item in a menu, breadcrumb, or multi-step process
aria-invalid="true|false" Indicates that a form's input value fails validation

Free account

Track your progress

XP earned 0 Day streak 0 Spaces 0 League —

New

Learn in Adventure Mode W3Schools Adventure App

Coding fundamentals as bite-sized lessons and challenges.

×

Contact Sales

If you want to use W3Schools services as an educational institution, team or enterprise, send us an e-mail:
sales@w3schools.com

Report Error

If you want to report an error, or if you want to make a suggestion, send us an e-mail:
help@w3schools.com

W3Schools is optimized for learning and training. Examples might be simplified to improve reading and learning. Tutorials, references, and examples are constantly reviewed to avoid errors, but we cannot warrant full correctness of all content. While using W3Schools, you agree to have read and accepted our terms of use, cookies and privacy policy.

Copyright 1999-2026 by W3Schools. All Rights Reserved. W3Schools is Powered by W3.CSS.