Using a tag with dropdown option

时间:2016-10-20 12:43:33

标签: html

The up and down arrow keys are not working when the anchor tag is used instead of the button tag. Please help me out.

<div class="dropdown">
    <a class="btn btn-primary dropdown-toggle" data-toggle="dropdown">Dropdown Example<span class="caret"></span></a>
    <ul class="dropdown-menu">
      <li><a >HTML</a></li>
      <li><a >CSS</a></li>
      <li><a >JavaScript</a></li>
    </ul>
  </div>

1 个答案:

答案 0 :(得分:0)

通过在每个锚标记中指定tabindex = -1,可以返回箭头键功能。

我自己得到了答案。谢谢大家。