← CodeClarityLab Home
Browse by Category
+ added · updated 7d
← Back to glossary

Web Accessibility (WCAG & ARIA)

frontend HTML5 Intermediate
debt(d5/e5/b5/t7)
d5 Detectability Operational debt — how invisible misuse is to your safety net

Closest to 'specialist tool catches it' (d5). The detection_hints list axe, lighthouse, wave, and nvda — all specialist accessibility tools. Common automated linters do not catch most accessibility issues (missing labels, focus ring removal, ARIA misuse), and many issues (e.g. incorrect ARIA roles with no keyboard handler) require runtime testing with assistive technology. Automated tools catch a meaningful subset but not all cases, placing this squarely at d5.

e5 Effort Remediation debt — work required to fix once spotted

Closest to 'touches multiple files / significant refactor in one component' (e5). The quick_fix covers several distinct actions: adding alt text, associating labels, ensuring focus visibility, and testing Tab navigation. Common mistakes span multiple patterns (div/span misuse, missing alt, missing labels, incorrect ARIA). Fixing accessibility across a page or component requires touching many elements and potentially refactoring interactive components to use semantic HTML, which is more than a single-line patch but typically scoped within a component rather than a full architectural rework.

b5 Burden Structural debt — long-term weight of choosing wrong

Closest to 'persistent productivity tax' (b5). Accessibility applies broadly to all web contexts (applies_to: web) and affects every interactive UI element, form, image, and dynamic content update. It imposes an ongoing discipline across the frontend — every new component must be designed and tested with accessibility in mind. However, it does not reshape the entire system architecture, so b7 would be too high. It is more than a localised tax (b3) since it affects all UI work streams.

t7 Trap Cognitive debt — how counter-intuitive correct behaviour is

Closest to 'serious trap' (t7). The misconception is explicit: developers believe adding ARIA attributes makes an element accessible, when in fact incorrect ARIA usage (e.g. role='button' on a non-focusable div) is actively worse than no ARIA. This directly contradicts the intuitive expectation that more annotation equals more accessibility. It also contradicts patterns from similar concepts (e.g. CSS classes that are purely visual), making it a serious trap for competent developers unfamiliar with ARIA semantics.

About DEBT scoring →

Also Known As

web accessibility a11y ARIA WCAG

TL;DR

Building web UIs usable by people with disabilities — following WCAG guidelines and using ARIA roles only when semantic HTML is insufficient.

Explanation

WCAG 2.1 organises requirements under four principles (POUR): Perceivable (alt text for images, captions for video, sufficient colour contrast ≥4.5:1), Operable (keyboard navigation, focus indicators, no seizure-inducing content), Understandable (clear labels, consistent navigation, error messages), Robust (valid HTML, ARIA correctly used). ARIA (Accessible Rich Internet Applications) supplements semantic HTML for complex widgets — role='dialog', aria-expanded, aria-live for dynamic content. Golden rule: use native HTML elements first (a button is better than a div with role='button' and tabindex='0' and keyboard handlers). Test with a screen reader (NVDA, VoiceOver) and keyboard-only navigation. For PHP-generated HTML, validate output with axe-core or Lighthouse.

Common Misconception

Adding ARIA attributes to any element makes it accessible. Incorrect ARIA usage is worse than no ARIA — a div with role="button" but no keyboard handler is announced as a button to screen readers but does not respond to keyboard activation. Semantic HTML elements have built-in accessibility; ARIA augments where native semantics are insufficient.

Why It Matters

Semantic HTML and ARIA attributes make pages usable by screen readers, keyboard-only users, and assistive technology — accessibility is a legal requirement in many jurisdictions and improves SEO.

Common Mistakes

  • Using div and span for interactive elements instead of button and a — keyboard and screen reader support is lost.
  • Missing alt attributes on images — screen readers read file names instead.
  • Form inputs without associated labels — screen readers cannot describe what the input is for.
  • ARIA attributes that contradict the underlying semantic HTML — role=button on a div that cannot receive focus.

Code Examples

💡 Note
Keyboard-only users can Tab to a <button> and activate with Enter/Space. A <div onclick> is invisible to them and to screen readers.
✗ Vulnerable
<div onclick="submitForm()">Submit</div>
<div class="red">This field is required</div>
<img src="logo.png">
✓ Fixed
<!-- Use native elements — keyboard accessible, screen reader friendly -->
<button type="submit" onclick="submitForm()">Submit</button>

<!-- Associate error with input -->
<input id="email" aria-describedby="email-error" aria-invalid="true">
<span id="email-error" role="alert">This field is required</span>

<!-- Always provide alt text -->
<img src="logo.png" alt="Acme Corp logo">
<!-- Decorative images: empty alt, role=presentation -->
<img src="divider.png" alt="" role="presentation">

Added 15 Mar 2026
Edited 22 Mar 2026
Views 29
Rate this term
No ratings yet
🤖 AI Guestbook educational data only
| |
Last 30 days
1 ping F 0 pings S 0 pings S 0 pings M 0 pings T 0 pings W 0 pings T 2 pings F 0 pings S 2 pings S 0 pings M 0 pings T 0 pings W 0 pings T 1 ping F 0 pings S 0 pings S 0 pings M 0 pings T 0 pings W 1 ping T 1 ping F 0 pings S 1 ping S 0 pings M 0 pings T 0 pings W 0 pings T 1 ping F 0 pings S
No pings yet today
Perplexity 7 Amazonbot 7 Google 3 Ahrefs 2 Unknown AI 2 SEMrush 2 Majestic 1
crawler 22 crawler_json 2
DEV INTEL Tools & Severity
🟠 High ⚙ Fix effort: Medium
⚡ Quick Fix
Add alt text to all images, associate every input with a <label>, ensure keyboard focus is always visible, and test Tab navigation through the entire page
📦 Applies To
html HTML5 web
🔗 Prerequisites
🔍 Detection Hints
Images without alt attribute; inputs without associated labels; outline:none removing focus ring; click handlers on non-focusable elements
Auto-detectable: ✓ Yes axe lighthouse wave nvda
⚠ Related Problems
🤖 AI Agent
Confidence: High False Positives: Medium ✗ Manual fix Fix: Medium Context: File Tests: Update

✓ schema.org compliant