Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR HTML

keyboard accessible buttons on navbar

<div class="menu_button">
  <button id="menubutton"
          aria-haspopup="true"
          aria-controls="menu2">
    WAI-ARIA Quick Links
  </button>
  <ul id="menu2"
      role="menu"
      aria-labelledby="menubutton">
    <li role="none">
      <a role="menuitem" href="https://www.w3.org/">
        W3C Home Page
      </a>
    </li>
    <li role="none">
      <a role="menuitem" href="https://www.w3.org/standards/webdesign/accessibility">
        W3C Web Accessibility Initiative
      </a>
    </li>
    <li role="none">
      <a role="menuitem" href="https://www.w3.org/TR/wai-aria/">
        Accessible Rich Internet Application Specification
      </a>
    </li>
    <li role="none">
      <a role="menuitem" href="https://www.w3.org/TR/wai-aria-practices/">
        WAI-ARIA Authoring Practices
      </a>
    </li>
    <li role="none">
      <a role="menuitem" href="https://www.w3.org/TR/wai-aria-implementation/">
        WAI-ARIA Implementation Guide
      </a>
    </li>
    <li role="none">
      <a role="menuitem" href="https://www.w3.org/TR/accname-aam-1.1/">
        Accessible Name and Description
      </a>
    </li>
  </ul>
  <script type="text/javascript">
    window.onload=function() {
    var menubutton = new Menubutton(document.getElementById('menubutton'));
    menubutton.init();
  </script>
</div>
Source by www.w3.org #
 
PREVIOUS NEXT
Tagged: #keyboard #accessible #buttons #navbar
ADD COMMENT
Topic
Name
3+4 =