title: How to make a UL list of buttons accessible?
body: <p>In my code I have a list of buttons stored in an unordered list. If you enable a screen reader and you tab into any <code>li</code> element, most readers will read out which element you're on out of how many is on the list (e.g. &quot;List item 1, item 2 of 4&quot;).</p>
  <p>What I was curious about is it possible to merge the two so that when you tab, you tab onto the button but you also get the list item information read out by the screen reader.</p>
  <p>Below is example code of my current code (first) and the second is just to illustrate the screen reader voicing 2 of 4.</p>
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;div&gt;
    This example shows that you tab straight to the button but don't get the list information
    &lt;ul&gt;
      &lt;li&gt;&lt;button onClick="alert('Button 1')"&gt;Button 1&lt;/button&gt;&lt;/li&gt;
      &lt;li&gt;&lt;button onClick="alert('Button 2')"&gt;Button 2&lt;/button&gt;&lt;/li&gt;
      &lt;li&gt;&lt;button onClick="alert('Button 3')"&gt;Button 3&lt;/button&gt;&lt;/li&gt;
      &lt;li&gt;&lt;button onClick="alert('Button 4')"&gt;Button 4&lt;/button&gt;&lt;/li&gt;
    &lt;/ul&gt;
  &lt;/div&gt;
  &lt;div&gt;
    This example shows that if you add tab index on a list item you get the count of items in the list
    &lt;ul&gt;
      &lt;li tabindex="0"&gt;&lt;button onClick="alert('Button 1')"&gt;Button 1&lt;/button&gt;&lt;/li&gt;
      &lt;li tabindex="0"&gt;&lt;button onClick="alert('Button 2')"&gt;Button 2&lt;/button&gt;&lt;/li&gt;
      &lt;li tabindex="0"&gt;&lt;button onClick="alert('Button 3')"&gt;Button 3&lt;/button&gt;&lt;/li&gt;
      &lt;li tabindex="0"&gt;&lt;button onClick="alert('Button 4')"&gt;Button 4&lt;/button&gt;&lt;/li&gt;
    &lt;/ul&gt;
  &lt;/div&gt;</code></pre>
  </div>
  </div>
  </p>