Web accessibility - Practical Implementation and Resources
Understand how to implement WAI‑ARIA, conduct comprehensive accessibility audits, and leverage key resources and tools.
Summary
Read Summary
Flashcards
Save Flashcards
Quiz
Take Quiz
Quick Practice
What is a common accessibility issue when scripts are used to create custom controls in web applications?
1 of 15
Summary
Accessible Web Applications and WAI-ARIA
The Challenge: Dynamic Web Applications and Semantic Information
Modern web applications often use JavaScript to create rich, interactive interfaces with custom controls. The problem is that these custom-built components frequently lack semantic information—the underlying meaning that assistive technologies like screen readers rely on to understand what a component does and how it behaves.
Consider a developer who creates a custom toggle button using a generic <div> element styled to look and behave like a button. A sighted user will see it clearly as a button that can be clicked. However, assistive technology users face a serious problem: a screen reader cannot determine what this <div> actually does or whether it's currently activated. The semantic meaning is invisible to assistive technologies, making the interface inaccessible.
This is where WAI-ARIA enters the picture.
What is WAI-ARIA?
WAI-ARIA (Web Accessibility Initiative – Accessible Rich Internet Applications) is a specification developed by the W3C that allows developers to add semantic information to custom web components. Think of ARIA as a communication bridge: it lets developers explicitly tell assistive technologies what custom elements mean and how they behave.
WAI-ARIA works by adding attributes to HTML elements in four key categories:
Roles describe what an element is. When you add role="button" to a <div>, you're telling assistive technology that this element should be treated as a button, even though it's not a native HTML <button> element. Common roles include button, menu, dialog, tab, and checkbox.
States describe the current condition of an element and change as users interact with it. For example, aria-pressed="true" indicates that a toggle button is currently activated, while aria-expanded="false" indicates that a collapsible panel is closed. When states change (like when a user clicks the button), these attributes should be updated to reflect the new status.
Properties describe persistent characteristics or relationships of elements. Unlike states which change frequently, properties tend to remain constant. For instance, aria-label provides a text description for an element, and aria-labelledby creates a relationship between an element and another element that labels it.
Relationships express how elements connect to one another. Properties like aria-owns establish logical hierarchies, aria-controls indicates which elements an interactive control affects, and aria-describedby links an element to additional descriptive text.
Implementing ARIA in Practice
Implementing ARIA effectively means making three deliberate choices for custom components:
1. Assign appropriate roles. Identify what standard control your custom component most resembles and apply that role. A custom toggle switch should have role="switch", a custom dropdown should have role="listbox", and a custom menu button should have role="menu". This is the foundation—without the correct role, assistive technologies won't understand the basic purpose of the component.
2. Apply state attributes to reflect dynamic changes. When something happens in your interface—a button is pressed, a section expands, a checkbox is selected—update the relevant ARIA state attributes. A toggle button pressed by the user should have its aria-pressed attribute changed from false to true. A disclosure button that opens a hidden panel should update aria-expanded from false to true. These updates should happen in real-time as the user interacts with the interface.
3. Provide clear ARIA labels. Users need to understand what a control does. Use aria-label to provide a concise, accessible name for elements that don't have visible text labels. Alternatively, use aria-labelledby to reference another element on the page that provides the label. Avoid vague labels—a button labeled "Click here" is far less helpful than one labeled "Submit form" or "Close navigation menu."
It's worth noting that ARIA is not a substitute for native HTML semantics. Whenever possible, use native elements like <button>, <input>, <nav>, and <main> because they come with built-in semantics and keyboard handling. ARIA should only be used to enhance or clarify custom components when native HTML won't suffice.
Focus Management and Keyboard Navigation
Beyond semantic attributes, WAI-ARIA provides mechanisms for managing focus—which element on the page currently receives keyboard input. Keyboard users navigate interfaces by pressing Tab to move forward through focusable elements and Shift+Tab to move backward.
When you build custom interactive components, you must ensure that focus moves logically through them and that users can control them with the keyboard. For dynamic interfaces that show and hide content (like modal dialogs or dropdown menus), ARIA helps manage where focus should move when the interface changes. Techniques like moving focus into a newly opened dialog or managing focus within a menu ensure that keyboard users can reliably navigate without confusion.
Website Accessibility Audits
Why Audits Matter
An accessibility audit is a systematic examination of a website designed to identify barriers that prevent people with disabilities from accessing content and completing tasks. Audits move beyond theory—they find real, concrete problems and provide recommendations for fixing them.
The purpose of an audit is twofold: (1) to discover what's broken, and (2) to guide remediation efforts toward genuine accessibility improvements.
Three Approaches to Auditing
Effective accessibility auditing actually combines three complementary methods, each with distinct strengths:
Automated Testing Tools scan web pages and check them against a database of known accessibility violations. These tools are fast and can check dozens or hundreds of pages quickly. They excel at catching obvious issues—missing alt text on images, missing form labels, insufficient color contrast—that can be detected through code analysis. However, automated tools have important limitations: they produce false positives (flagging issues that aren't actually problems in context), they can't understand the meaning of content, and they miss complex accessibility problems that require human judgment.
Expert Technical Review involves skilled accessibility specialists manually examining representative pages of a website. An expert can understand the intent of content, evaluate whether ARIA is being used correctly, assess whether keyboard navigation works smoothly, test how components behave with real assistive technology, and provide detailed guidance on fixing problems. The downside is that manual review is time-consuming and expensive, so experts typically can't review every page on large websites. They focus on representative samples instead.
User Testing observes real people with disabilities using the website to accomplish realistic tasks. This is the most powerful way to find practical, real-world accessibility problems. A user test might reveal that although a menu technically works with a screen reader, the experience is so confusing that real users abandon the task. Conversely, an automated tool might flag an issue that users actually handle just fine. User testing uncovers the actual experience of accessing your site, not just theoretical compliance with standards.
The best practice is to combine all three approaches. Start with automated scanning to catch low-hanging fruit quickly and cost-effectively. Follow with expert review to identify and solve complex problems. Finally, conduct user testing with people with disabilities to validate that your accessibility improvements actually work in the real world and don't create new problems.
Evaluation Tools: Strengths and Critical Pitfalls
Automated accessibility evaluation tools are valuable but imperfect. Understanding their limitations is crucial for using them effectively.
False Positives and Context Issues are the biggest pitfall. A tool might flag that text lacks sufficient color contrast, but if that text is a background watermark, low contrast might be intentional and acceptable. A tool might flag missing alt text on an image that's purely decorative and shouldn't have alt text. The tool has no way to understand context, so it produces warnings that don't represent real problems.
Manual testing remains essential precisely because of these limitations. Even after running automated tools and getting a clean report, a real person must review the results with critical judgment. Is this flagged issue actually a problem? Does this code snippet actually create an accessibility barrier? Tools guide your work, but they don't replace human expertise.
Additionally, be cautious about excessive focus on testability and measurement. If you optimize your website purely to pass automated tests, you might achieve high test scores while still creating poor experiences for actual users. A component might be "technically accessible" by passing automated tests but be frustrating or confusing to use in practice. Accessibility is about real human experience, not just passing automated scans.
<extrainfo>
External Resources and Standards
Several authoritative organizations provide guidelines and resources for web accessibility professionals:
The W3C Web Accessibility Initiative publishes the official Web Content Accessibility Guidelines (WCAG), the technical specifications for WAI-ARIA, and detailed implementation techniques. This is the primary source for accessibility standards and best practices.
Platform-Specific Resources help developers create accessible applications for specific ecosystems:
Apple Developer Accessibility Resources provide guidelines and APIs for iOS and macOS applications
Google Developer Accessibility Resources cover Android and web accessibility best practices
Microsoft Developer Accessibility Resources focus on Windows and web applications
BBC Inclusive Design Principles outline an approach to inclusive design that goes beyond minimum compliance, emphasizing that accessibility benefits everyone, not just people with disabilities.
Standards and Methodologies like the British Standards Institute's BS 8878 code of practice and the European Union's Unified Web Evaluation Methodology provide frameworks for embedding accessibility into development processes and evaluating accessibility systematically.
</extrainfo>
Flashcards
What is a common accessibility issue when scripts are used to create custom controls in web applications?
They often lack native HTML semantics.
What is the consequence of missing semantics for assistive technologies?
They cannot convey the purpose or state of interactive elements.
What four types of attributes does WAI-ARIA allow authors to add to custom widgets?
Role
State
Property
Relationship
What three characteristics of a component do ARIA attributes describe?
Behavior
Current status (e.g., expanded or selected)
Relationships (e.g., labeling)
What is the primary purpose of a website accessibility audit?
To systematically identify barriers preventing users with disabilities from accessing content.
What do accessibility audits provide to help achieve compliance with standards?
Recommendations and guidance for remediation.
Which three components comprise the best-practice approach for a comprehensive accessibility assessment?
Automated scanning
Expert review
User testing
What is a major advantage of using automated accessibility testing tools?
They can scan many pages quickly to reveal known violations.
What happens during a manual expert technical review for accessibility?
Specialists examine representative pages to provide detailed feedback on a broad range of issues.
What is a primary limitation of manual expert reviews on large websites?
The process is time-consuming and may not cover every page.
What does user testing for accessibility involve?
Observing real users with disabilities performing typical tasks on the website.
What is the unique benefit of user testing compared to automated or expert reviews?
It uncovers practical problems that other methods may not detect.
Why is manual testing essential even when using automated evaluation tools?
Tools can produce false positives or overlook context-specific issues.
What kind of resources does the W3C Web Accessibility Initiative provide?
Official specifications, techniques, and educational material.
What is the focus of the British Standards Institute's BS 8878:2010 code of practice?
Embedding accessibility into web development processes.
Quiz
Web accessibility - Practical Implementation and Resources Quiz Question 1: Why might custom controls created with scripts be problematic for accessibility?
- They often lack native HTML semantics (correct)
- They are automatically labeled by screen readers
- They are always keyboard accessible
- They require no additional ARIA attributes
Web accessibility - Practical Implementation and Resources Quiz Question 2: Which organization provides the official specifications and techniques for web accessibility?
- The W3C Web Accessibility Initiative (correct)
- British Standards Institute
- European Union Unified Web Evaluation Methodology
- Apple Developer Accessibility Resources
Web accessibility - Practical Implementation and Resources Quiz Question 3: When creating a custom widget that functions like a button, which ARIA role should be applied to the element?
- button (correct)
- navigation
- heading
- listbox
Web accessibility - Practical Implementation and Resources Quiz Question 4: Which company's developer site offers best‑practice guidelines for building accessible Android and web experiences?
- Google (correct)
- Apple
- Microsoft
- BBC
Why might custom controls created with scripts be problematic for accessibility?
1 of 4
Key Concepts
Accessibility Standards and Guidelines
W3C Web Accessibility Initiative
BS 8878:2010
EU Unified Web Evaluation Methodology (UWE) 1.2
Accessibility Testing Methods
Web Accessibility Audit
Automated Accessibility Testing Tool
Accessibility User Testing
Accessibility Pitfalls in Evaluation Tools
Design and Implementation Techniques
WAI‑ARIA
Focus Management
Inclusive Design
Definitions
WAI‑ARIA
A specification that enables developers to add semantic roles, states, and properties to custom web components for assistive technologies.
Web Accessibility Audit
A systematic assessment that identifies barriers preventing users with disabilities from accessing web content and provides remediation guidance.
Automated Accessibility Testing Tool
Software that scans web pages for known accessibility violations, offering rapid but partial compliance checks.
Accessibility User Testing
Observational studies with disabled users performing typical tasks to uncover practical accessibility problems not detected by automated methods.
Focus Management
Techniques for controlling keyboard focus order and navigation in dynamic web interfaces to ensure reliable access for keyboard users.
W3C Web Accessibility Initiative
The World Wide Web Consortium program that develops standards, guidelines, and educational resources for web accessibility.
BS 8878:2010
The British Standards Institute code of practice outlining how to embed accessibility into web development processes.
EU Unified Web Evaluation Methodology (UWE) 1.2
A European standard providing a unified approach for evaluating web accessibility across EU member states.
Inclusive Design
A design philosophy that creates products and services usable by the widest possible range of people, regardless of ability.
Accessibility Pitfalls in Evaluation Tools
Common issues where automated tools produce false positives or miss context‑specific problems, necessitating manual testing.