DevPrep
  • Interview Prep
  • Projects
  • Resources
  • Pricing
  • About Us
Submit Question
DevPrep
  • Pricing
  • About Us
Submit Question
  1. Home
  2. Articles
  3. Frontend Engineering
  4. Accessibility (a11y): Building Inclusive Web Applications
XLinkedInReddit
MediumFrontend Engineering

Accessibility (a11y): Building Inclusive Web Applications

D
DevPrep Team
February 10, 2026·2 min read·0
Table of Contents
  • The Four Principles (POUR)
  • Semantic HTML is 80% of the Battle
  • ARIA: Use Sparingly
  • Keyboard Navigation
  • Quick Wins Checklist

At Google, accessibility isn't optional — it's a launch requirement. 15% of the global population has some form of disability.

The Four Principles (POUR)

  • Perceivable: Users can perceive the content (alt text, captions, contrast)
  • Operable: Users can interact (keyboard nav, no time limits)
  • Understandable: Content is clear (labels, error messages, predictable)
  • Robust: Works with assistive technologies (semantic HTML, ARIA)

Semantic HTML is 80% of the Battle

<!-- Bad -->
<div class="button" onclick="submit()">Submit</div>

<!-- Good -->
<button type="submit">Submit</button>

<!-- Bad -->
<div class="nav">...</div>

<!-- Good -->
<nav aria-label="Main navigation">...</nav>

ARIA: Use Sparingly

The first rule of ARIA is: don't use ARIA if you can use native HTML. ARIA doesn't add behavior — only semantics.

<!-- Custom dropdown -->
<div role="listbox" aria-label="Select country" aria-expanded="true">
  <div role="option" aria-selected="true">India</div>
  <div role="option" aria-selected="false">USA</div>
</div>

<!-- Live region for dynamic content -->
<div aria-live="polite" aria-atomic="true">
  {statusMessage}
</div>

Keyboard Navigation

// Focus management in React
function Modal({ isOpen, onClose, children }) {
  const firstFocusRef = useRef();
  
  useEffect(() => {
    if (isOpen) firstFocusRef.current?.focus();
  }, [isOpen]);
  
  // Trap focus inside modal
  function handleKeyDown(e) {
    if (e.key === "Escape") onClose();
    if (e.key === "Tab") trapFocus(e);
  }
  
  return isOpen ? (
    <div role="dialog" aria-modal="true" onKeyDown={handleKeyDown}>
      <button ref={firstFocusRef}>Close</button>
      {children}
    </div>
  ) : null;
}

Quick Wins Checklist

  • All images have descriptive alt text (or alt="" for decorative)
  • Color contrast ratio ≥ 4.5:1 for normal text, ≥ 3:1 for large text
  • All interactive elements are keyboard accessible
  • Form inputs have associated <label> elements
  • Skip navigation link for keyboard users
  • Focus styles are visible (never outline: none without replacement)

Related Articles

MediumFrontend Engineering

System Design #12: Design a Multi-Step Form Wizard

7 min read
MediumFrontend Engineering

Mastering Senior-Level JavaScript Interview Concepts

2 min read
MediumFrontend Engineering

System Design #9: Design a Collaborative Text Editor

9 min read

Comments (0)

Sign in to leave a comment.

No comments yet. Be the first to comment.

Table of Contents

  • The Four Principles (POUR)
  • Semantic HTML is 80% of the Battle
  • ARIA: Use Sparingly
  • Keyboard Navigation
  • Quick Wins Checklist

Series

View all Frontend Engineering articles →

Practice

  • JavaScript
  • DSA
  • Machine Coding
  • System Design

Resources

  • Learning Tracks
  • Articles
  • Roadmaps
  • Compare Concepts
  • Glossary
  • Developer Tools
  • All Questions

Company

  • About
  • Pricing

Legal

  • Privacy Policy
  • Terms of Service
DevPrep

© 2026 DevPrep. All rights reserved.