♿ Module 11 · ARIA🔴 AdvancedLESSON 40 · MODULE FINAL

Advanced Accessibility (ARIA)

⏱️ 16 min read
📖 Theory + Code
🧩 5 Quiz Questions
🏗️ 1 Challenge
Course progress19%
🎯 What you'll learn: aria-label, aria-labelledby, role, tabindex, skip links, and live regions — for when semantic HTML alone isn't enough.

The First Rule of ARIA

The official first rule of ARIA is: don't use ARIA if a native HTML element already does the job. A real <button> is automatically keyboard-accessible and announced correctly — a <div role="button"> requires you to manually replicate all of that behavior.

⚠️
ARIA can make things worse
Incorrect ARIA is often worse than no ARIA at all — it can override the correct native semantics with wrong ones. Use it to fill gaps, not to replace native elements you could have used instead.

aria-label & aria-labelledby

aria-label provides an accessible name directly as a string — useful for icon-only buttons with no visible text. aria-labelledby instead points to the id of another element that already contains the label text.

aria-label.html
HTML
<button aria-label="Close dialog"></button>

<h2 id="billing-title">Billing Address</h2>
<div aria-labelledby="billing-title">...</div>

role & tabindex

The role attribute tells assistive tech what a custom element behaves as, when you can't avoid a non-semantic element. tabindex="0" makes an otherwise unfocusable element reachable by keyboard Tab; tabindex="-1" removes it from the tab order while still allowing programmatic focus.

role-tabindex.html
HTML
<div role="button" tabindex="0" onclick="submitForm()">
  Submit
</div>
<!-- Better: just use <button>Submit</button> instead -->

Skip Links & Live Regions

A skip link is a hidden-until-focused link at the very top of the page that jumps keyboard users straight to main content, bypassing repetitive navigation. An ARIA live region announces dynamic content changes — like a form error appearing — without the user needing to move focus there.

skip-link-live.html
HTML
<a href="#main" class="skip-link">Skip to main content</a>

<div aria-live="polite" id="formStatus"></div>
<!-- JS updates formStatus.textContent — screen readers announce it automatically -->
FeaturePurpose
aria-labelAccessible name as a plain string
aria-labelledbyAccessible name from another element's id
roleDescribes behavior of a non-semantic element
tabindex="0"/"-1"Controls keyboard focus order
Skip linkLets keyboard users bypass repeated navigation
aria-liveAnnounces dynamic content changes automatically
🧩 Knowledge Check — Lesson 40
5 questions to test your understanding.
1. What is the "first rule of ARIA"?
2. When is aria-label most useful?
3. What does tabindex="-1" do?
4. What does a skip link do?
5. What does an ARIA live region do?
💪
Coding Challenge — Lesson 40
Apply what you learned · Advanced Level
Challenge: Build an Accessible Icon Button + Skip Link

Add a skip link at the top of a page pointing to "#main", and build a close icon button (✕) with aria-label="Close" instead of visible text.
💡 Show hints if you're stuck
  • Skip link: <a href="#main" class="skip-link">Skip to main content</a>
Module 11 Complete!
You can now make custom widgets accessible with ARIA. Next up: SEO Meta Tags.
Finished this lesson?
Mark it complete to track your progress.
🎉

Lesson 40 Complete — Module 11 Finished!

You've mastered ARIA accessibility. On to SEO Meta Tags!

Lesson 40 of 62Module 11 — Accessibility (ARIA)