It is ok to not know everything.
It is ok to say I got triggered never mind.
It is ok to say this is the best practice (mantra, rule of thumb), which I follow and never questioned myself.
It isn't ok to call code bad without explaining why. I can quote Kurt Vonnegut on this: "Dr. Hoenikker used to say that any scientist who couldn't explain to an eight-year-old what he was doing was a charlatan".
I don't intend top write a second article in the comments
I didn't ask you to write an article I asked to pinpoint at least one example to show the difference between button and div role="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.
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.
It is ok to not know everything.
It is ok to say I got triggered never mind.
It is ok to say this is the best practice (mantra, rule of thumb), which I follow and never questioned myself.
It isn't ok to call code bad without explaining why. I can quote Kurt Vonnegut on this: "Dr. Hoenikker used to say that any scientist who couldn't explain to an eight-year-old what he was doing was a charlatan".
I didn't ask you to write an article I asked to pinpoint at least one example to show the difference between
button
anddiv role="button"
.Read the linked article. The author explaines everything you need.
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.