Upgrade to Pro — share decks privately, control downloads, hide ads and more …

WAI-ARIAを活用したJavaScriptによるDOM操作

 WAI-ARIAを活用したJavaScriptによるDOM操作

第六回okayama-js勉強会でお話しました

Masayuki Maekawa

November 20, 2016
Tweet

More Decks by Masayuki Maekawa

Other Decks in Technology

Transcript

  1. <li> <a id="drop1" href="#" role="button" aria- expanded="true">Dropdown</a> <ul role="menu" aria-labelledby="drop1">

    <li role="presentation"><a role="menuitem" href=“http://…”>Action</a></li> </ul> </li>
  2. /* CSS */
 <style>
 [aria-expanded="false"] + ul{
 display: none;
 }


    </style> //JavaScript(jQuery)
 $('#hoge').attr(
 'aria-expanded',
 $(‘#hoge’).attr('aria-expanded') !== 'true'
 );