What’s the difference between <button type="button"> and <div class="button" role="button" tabindex="0">, you ask? It’s the behavior.
In her talk “ARIA, accessibility APIs & coding like you give a damn!”, Léonie Watson demonstated what it would take to turn a <div> into a button. And it takes a lot! (Video • Slides)
TL;DR: Don’t do it! Use the <button> element.
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Button
What’s the difference between
<button type="button">
and<div class="button" role="button" tabindex="0">
, you ask? It’s the behavior.In her talk “ARIA, accessibility APIs & coding like you give a damn!”, Léonie Watson demonstated what it would take to turn a
<div>
into a button. And it takes a lot! (Video • Slides)TL;DR: Don’t do it! Use the
<button>
element.