I've noticed in all of Bootstrap's examples using button
elements, they include role="button"
(and type="button"
), such as:
<div class="dropdown">
<button id="dLabel" type="button" role="button" data-toggle="dropdown"
aria-haspopup="true" aria-expanded="false">
Dropdown trigger <span class="caret"></span>
</button>
<ul class="dropdown-menu" role="menu" aria-labelledby="dLabel">
...
</ul>
</div>
Won't accessibility software already know that a button
element is meant to act as a button? Is there any reason I should include role="button"
and/or type="button"
in my code?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…