216digital.
Web Accessibility

ADA Risk Mitigation
Prevent and Respond to ADA Lawsuits


WCAG & Section 508
Conform with Local and International Requirements


a11y.Radar
Ongoing Monitoring and Maintenance


Consultation & Training

Is Your Website Vulnerable to Frivolous Lawsuits?
Get a Free Web Accessibility Audit to Learn Where You Stand
Find Out Today!

Web Design & Development

Marketing

PPC Management
Google & Social Media Ads


Professional SEO
Increase Organic Search Strength

Interested in Marketing?
Speak to an Expert about marketing opportunities for your brand to cultivate support and growth online.
Contact Us

About

Blog

Contact Us
  • The Importance of Keyboard Accessibility & Why ARIA Widgets Don’t Work

    Keyboard accessibility is a fundamental part of creating an accessible web experience. For many people, including those with motor impairments, the ability to navigate a website using only a keyboard is essential. Unfortunately, not all website interactive elements are designed with keyboard users in mind. This is where ARIA (Accessible Rich Internet Applications) widgets often come into play—intended to improve accessibility but frequently falling short when misused.

    Understanding the principles of keyboard accessibility and the limitations of ARIA widgets can help website owners, developers, and content creators deliver a more inclusive user experience. Let’s explore the most common keyboard accessibility issues, why ARIA widgets often miss the mark, and how you can design your website to meet Web Content Accessibility Guidelines (WCAG) standards.

    Why Keyboard Accessibility Matters

    Keyboard accessibility ensures that all interactive elements on a website—like buttons, forms, links, and menus—are reachable and usable without needing a mouse. Many users, such as those with motor disabilities or vision impairments, rely on keyboards, screen readers, or other assistive devices to navigate web content.

    Without keyboard accessibility, people using assistive technology can encounter significant barriers, preventing them from completing tasks or navigating the site. For instance, a checkout form that only allows interaction through mouse clicks will stop a keyboard user in their tracks, impacting their ability to purchase a product or service.

    Common Barriers to Keyboard Accessibility

    Some of the most common obstacles that keyboard users face on websites include:

    Lack of Focus Indicators

    • Problem: Without visible focus indicators, keyboard users may not know where they are on the page. This becomes particularly frustrating when navigating forms or interactive menus.
    • Solution: Use CSS to style focus indicators and make them highly visible, such as by changing the border color, background, or outline. Here’s an example:
    button:focus, a:focus {
    	outline: 3px solid #005fcc;
    	background-color: #f0f8ff;
    }

    Improper Tab Order

    • Problem: Elements on a page need to logically match the visual layout. Without a logical tab order, users may be taken through an erratic sequence, which can lead to confusion and missed information.
    • Solution: Arrange your elements in HTML to follow the intended visual order and limit use of the tabindex attribute. By default, elements will follow the document’s source order, so it’s best to organize your code this way.

    Focus Traps

    • Problem: Focus traps occur when users can’t tab away from a particular element, like a popup or modal. Once they’re stuck, the rest of the page becomes inaccessible until they can close the focus-trapped section.
    • Solution: Ensure focus returns to the main content once the user dismisses the popup or modal, using JavaScript if necessary:
    // Example of returning focus after modal close
    document.getElementById("closeModalButton").addEventListener("click", function() {
      document.getElementById("mainContent").focus();
    });

    ARIA Widgets and Their Challenges

    ARIA (Accessible Rich Internet Applications) is a set of attributes that help improve the accessibility of web applications, particularly for screen readers. However, ARIA widgets—such as dropdowns, sliders, and modals—often don’t work as expected for keyboard users if not implemented carefully. ARIA can enhance accessibility, but it can’t “fix” poor coding practices or make non-native elements fully functional on its own.

    Why ARIA Widgets Often Fail

    ARIA widgets can be highly effective but only if they’re properly coded, tested, and consistently used with accessibility in mind. Here are some common pitfalls:

    Reliance on ARIA Without Semantic HTML

    ARIA is not a replacement for HTML5 elements; it’s meant to enhance them. Using ARIA on elements that don’t support native keyboard interactions (like <div> for a button) means the widget might lack inherent keyboard functionality.

    For example, instead of creating a clickable div with ARIA, use a <button> tag. Buttons come with native keyboard functionality and don’t require extra scripting or attributes to work as expected.

    Overuse of role and tabindex Attributes

    Misusing role attributes can disrupt how screen readers interact with elements. For instance, assigning a role= "button" to a div won’t make it work the same way as a real button.

    Similarly, improper use of tabindex can cause elements to jump around in an illogical order. Stick to the natural flow of the DOM, using tabindex= "0" only when absolutely necessary to keep the order in sync.

    JavaScript-Dependent Behavior

    ARIA widgets often rely on JavaScript to replicate native interactions, but these scripts must be meticulously coded and tested. A JavaScript error could render an entire widget inaccessible.

    Testing your scripts thoroughly with keyboard-only navigation is essential, especially for ARIA widgets. Missing key events like “Enter” or “Escape” can trap users in a widget or make it difficult to interact with.

    Best Practices for Creating Keyboard-Accessible Interactive Elements

    To avoid these pitfalls and ensure that your site is truly keyboard accessible, follow these best practices:

    Prioritize Native HTML Elements

    Whenever possible, use native HTML elements for interactivity (like <button>, <a>, <input>, and <select>). They come with built-in accessibility and keyboard support, reducing the need for complex ARIA attributes or custom JavaScript.

    Use ARIA Judiciously

    Use ARIA only when there’s no HTML equivalent, like custom dropdowns or sliders. And if you do need ARIA attributes, implement them carefully with an understanding of their purpose. For example, use aria-expanded to indicate the open or closed state of a dropdown menu:

    <button aria-expanded="false" aria-controls="menu">Menu</button>
    <ul id= "menu" hidden>
      <li><a href="#home">Home</a></li>
      <li><a href="#about">About</a></li>
    </ul>

    Enable Logical Focus Management

    Ensure that interactive elements maintain a logical and intuitive focus order. When creating modals or popups, use JavaScript to trap focus within the modal until it’s closed and then return focus to the last element interacted with:

    const modal = document.getElementById("modal");
    const lastFocus = document.activeElement;
    // Trap focus within modal
    modal.addEventListener("keydown", (e) => {
      if (e.key === "Tab") {
        // Logic to keep focus within modal
      }
    });
    // Restore focus after modal close
    modal.addEventListener("close", () => {
      lastFocus.focus();
    });

    Include Skip Links

    Skip links are simple yet effective. They allow keyboard users to jump directly to the main content, bypassing repetitive navigation menus. Add a skip link that appears when focused, like this:

    <a href="#mainContent" class="skip-link">Skip to main content</a>
    <main id="mainContent">
      <!-- Main content here -->
    </main>

    The Importance of Testing for Keyboard Accessibility

    Testing is critical to achieving real keyboard accessibility. Use keyboard-only navigation to interact with your site, ensuring that each element responds to the Tab, Enter, and Escape keys appropriately. Here are a few tips for testing:

    1. Turn Off Your Mouse: Try navigating your site using only the keyboard. See if you can reach every interactive element and complete all tasks.
    2. Use Assistive Technology Simulators: There are free screen readers (such as NVDA or VoiceOver) that let you experience your website as a keyboard-only user would.
    3. Run Accessibility Audits: Automated tools like Google Lighthouse or WAVE can catch many keyboard accessibility issues, but a manual review is still necessary.

    Conclusion

    Keyboard accessibility is a must for ensuring inclusivity on your website. By avoiding ARIA misuse and sticking to native HTML elements where possible, you’ll reduce barriers for keyboard users and create a smoother experience. Remember, ARIA attributes can enhance interactivity, but they aren’t a substitute for accessible design principles.

    Testing with keyboard-only navigation will confirm that your site meets WCAG standards and shows your commitment to creating a web experience that everyone can enjoy—just in time for all your visitors to get the most out of your content and promotions. Reach out to 216digital using the contact form below if you’re unsure if your website is keyboard navigable.

    Bobby

    October 29, 2024
    How-to Guides
    ARIA, How-to, keyboard accessibility, web developers, web development
  • How to Implement ARIA Landmarks and Roles for Better Accessibility

    For users of assistive technologies, accessing and interacting with websites can be difficult if the proper structure and cues aren’t in place. This is where ARIA (Accessible Rich Internet Applications) landmarks and roles come in handy. Implementing ARIA landmarks and roles can significantly improve your website’s accessibility, helping users navigate more easily and interact with web elements effectively. If you’re new to ARIA, don’t worry! This guide will walk you through ARIA landmarks and roles, why they matter, and how to implement them step-by-step.

    What Is ARIA and Why Is It Important?

    ARIA is a set of HTML attributes intended to make webpages easier to navigate for people who rely on assistive technology, such as screen reading software. These attributes help bridge gaps in standard HTML that might not convey sufficient meaning to people with disabilities.

    By using ARIA, developers can label, describe, and define the functionality of elements in ways that ensure everyone has a better user experience. Regarding web accessibility, ARIA attributes are recommended in some cases by the Web Content Accessibility Guidelines (WCAG), which provide standards to help websites comply with accessibility requirements.

    ARIA landmarks and roles are two essential aspects of making sure your website content is accessible for all users to understand and interact with.

    ARIA Landmarks: What Are They?

    ARIA landmarks are unique markers you can add to different sections of your webpage to make navigation easier for users with disabilities. These landmarks help people who use screen readers understand the structure of a webpage and quickly jump to different sections. Think of them as signposts, making it clear where key sections—like the header, main content, navigation, and footer—are located.

    The major ARIA landmarks include:

    • <header>: Identifies the top section of the webpage.
    • <main>: Indicates the main content of the page.
    • <nav>: Points to the area that contains navigational links.
    • <footer>: The bottom section of the webpage.

    Why Are ARIA Landmarks Important?

    ARIA landmarks are invaluable for users with visual or motor impairments who use the keyboard or screen reader to navigate the web. They allow users to skip repetitive elements (like navigation bars) and jump directly to the content they’re looking for. Without these landmarks, a user would have to listen to every single line of the page to figure out where the main content starts or how to get to the footer. Using ARIA landmarks ensures that your website is easy to navigate for everyone.

    How to Implement ARIA Landmarks Step-by-Step

    Now that you understand the importance of ARIA landmarks let’s look at how to implement them in your website’s code. The good news? Adding ARIA landmarks is simple and can be done using standard HTML elements.

    Adding the Header Landmark

    The <header> element is used to define the global top section of your page, which typically contains things like the website logo, title, or main navigation links. Here’s an example of the correct usage of the HTML5 <header> region:

    <header>

    <h1>My Cool Website</h1>
    <h1>My Cool Website</h1>
      <nav>
        <ul>
          <li><a href="/">Home</a></li>
          <li><a href="/about">About</a></li>
          <li><a href="/products">Products</a></li>
        </ul>
      </nav>
    </header>

    The Main Landmark

    The <main> element is crucial because it defines the primary content of the page. The <main> element, along with a skip link, can allow users of assistive technology to skip past repetitive content such as the navigation:

    <main role="main">
      <h2>Main Content</h2>
      <p>This is the most important part of the page.</p>
    </main>

    By using role=”main”, you’re ensuring that screen readers can quickly identify and jump to the core content of your page. Only one main landmark should be used per page.

    Using the Navigation Landmark

    The navigation area of your website should be easy to identify and skip if necessary. You can use the <nav> element or the ARIA role, but you do not need to use both:

    <nav>
      <ul>
        <li><a href="#section1">Section 1</a></li>
        <li><a href="#section2">Section 2</a></li>
      </ul>
    </nav>
    <div role="navigation">
      <ul>
        <li><a href="/products">Products</a></li>
        <li><a href="/about">About Us</a></li>
      </ul>
    </div>

    With the navigation region, you’re clearly marking the section of the page that contains links for navigating to other parts of the site.

    Adding the Footer Landmark

    Finally, the <footer> element typically contains secondary content, such as copyright information or additional links. Adding a landmark here helps screen reader users know when they’ve reached the end of the page:

    <footer role="contentinfo">
      <p>&copy; 2024 Your Company</p>
    </footer>

    In this case, role= "contentinfo" tells screen readers that this section provides supplementary information about the website.

    ARIA Roles: What Are They?

    ARIA roles go beyond marking sections of the page—they describe the functionality of specific elements. By using ARIA roles, you’re defining how an element should behave or be interacted with, especially when using assistive technologies.

    Some commonly used ARIA roles include:

    • “button”: Makes non-biased elements like <div> behave like a button.
    • “dialog”: Defines a pop-up dialog window.
    • “alert”: Marks an element as an important alert that needs immediate attention.

    Why Are ARIA Roles Important?

    ARIA roles give more meaning to non-standard HTML elements. For example, if you create a custom button using a <div> instead of the traditional <button> element, a screen reader might not recognize it as a button. By assigning it an ARIA role, you ensure it’s interpreted correctly, making the interaction more intuitive and accessible.

    How to Implement ARIA Roles Step-by-Step

    Let’s check out some examples of proper ARIA implementation.

    Creating a Custom Button

    If you have a custom button element (like a <div> styled as a button), you can add the role="button" to make sure it’s recognized as an interactive button by screen readers:

    <div role="button" tabindex="0" onclick="submitForm()">Submit</div>

    The ARIA role “button” tells assistive technology to announce this element as a button, and the “tabindex” attribute makes the element focusable via the keyboard. However, it’s always best to use the correct semantic HTML5 <button> tag whenever possible.

    Adding a Dialog Role

    For models or pop-up windows, you can use the role= "dialog" to make them accessible:

    <div role="dialog" aria-labelledby="dialogTitle" aria-describedby="dialogDescription">
      <h2 id="dialogTitle">Confirmation</h2>
      <p id="dialogDescription">Are you sure you want to delete this file?</p>
      <button onclick="closeDialog()">Cancel</button>
    </div>

    The aria-labelledby and aria-describedby attributes help give context to the dialog box for users relying on assistive technologies.

    Creating an Alert

    If you need to display important, time-sensitive information—like an error message or form feedback—you can use the role= "alert":

    <div role="alert">
      <p>Error: The "password" field is required.</p>
    </div>

    This role makes sure that screen readers announce the alert immediately, ensuring the user doesn’t miss critical information.

    Going Beyond ARIA: Continue Your Accessibility Journey

    The HTML markup of your website is far more critical than just defining the visual style of the site. It is used by screen reading software, assistive technologies, and keyboard navigation to ensure users have easy access to content. SEO crawlers also use it to determine the accuracy and relevance of your content.

    By adding landmarks like header, main, navigation, and footer, and using roles like button, dialog, and alert, you’ll not only meet the accessibility standards outlined by WCAG, but you’ll also create a more user-friendly website for everyone.However, this is just one piece of the web accessibility puzzle.

    Team Up with 216digital

    At 216digital, we understand that keeping up with ADA compliance and accessibility best practices can be challenging. That’s why we’re here to help. We specialize in helping businesses achieve and maintain ADA compliance with expert guidance and actionable strategies. Schedule an ADA briefing with our experts today to learn more about how we can guide you through the complexities of accessibility, ensuring your website meets legal standards and delivers a great experience for all users. 

    Let’s make the web more accessible, together—book your ADA briefing today!

    Bobby

    September 6, 2024
    How-to Guides
    Accessibility, ADA Compliance, ARIA, How-to, WCAG, Web Accessibility, web development
Previous Page
1 2

Find Out if Your Website is WCAG & ADA Compliant







    By submitting this form, you consent to follow-up from 216 Digital by call, email, or text regarding your inquiry. Msg & data rates may apply. Reply STOP to opt out or HELP for help.

    216digital Logo

    Our team is full of professionals in Web Accessibility Remediation, eCommerce Design & Development, and Marketing – ready to help you reach your goals and thrive in a competitive marketplace. 

    216 Digital, Inc. BBB Business Review

    Get in Touch

    2208 E Enterprise Pkwy
    Twinsburg, OH 44087
    216.505.4400
    info@216digital.com

    Support

    Support Desk
    Acceptable Use Policy
    Accessibility Policy
    Privacy Policy

    Web Accessibility

    Settlement & Risk Mitigation
    WCAG 2.1/2.2 AA Compliance
    Monitoring Service by a11y.Radar

    Development & Marketing

    eCommerce Development
    PPC Marketing
    Professional SEO

    About

    About Us
    Contact

    Copyright © 2026 216digital. All Rights Reserved.