HNHacker News
TopNewBestAskShowJobs

cferdinandi

18 karma · joined October 31, 2025

submissionscomments
cferdinandi··on Just use a button
It's worth noting that VoiceOver is well-known for being a lot more lax than most other screen readers. Other options tend to be a lot more strict around standards and what they'll announce.
cferdinandi··on Just use a button
I would literally never use <input type="submit|button"> for anything when the <button> element is an option, personally.
cferdinandi··on Just use a button
That was a big part of "thought leader guy"'s argument in favor of divs, but not the only one.
cferdinandi··on Just use a button
The most common reason I've seen is whining about having to override default button styles.
cferdinandi··on Just use a button
Literally absolutely never ever do this.
cferdinandi··on Just use a button
I probably should have included "if you're building for the frontend you should probably know CSS". Good follow-up piece. Thanks for mentioning it!
cferdinandi··on Just use a button
It's the default for buttons inside forms, but it's SO trivial to add type="button" than any argument that div's are a better choice because of this should be dismissed as unserious trolling out-of-hand.
cferdinandi··on Just use a button
No. Objectively no.

It is INFINITELY easier to add type="button" than all of the other shit I mentioned in my article.

cferdinandi··on Just use a button
Hey, it's me, the original author!

The issue isn't with tabindex=0 specifically, but fucking with tabindex in general. People go down that path, and start putting that shit on everything, like it's Frank's Red Hot.

And in my experience, the same folks who use div's instead of button's are the ones who don't know better and start throwing tabindex around.

"why do you need to listen for events at the document level?"

Not events generally, keydown events specifically, which do not fire on child elements of the document.