I'm tired of watching developers spend hours solving problems that don't exist.
We have this innate need to work harder than we need to.
Working harder means spending hours writing custom JavaScript to make your <div>
behave like a button. It means manually adding ARIA labels, roles and keyboard handlers because you decided semantic HTML wasn't good enough.
It's fighting with focus management. Debugging why screen readers hate your custom dropdown. Patching accessibility issues one by one like you're playing a silly game of whack-a-mole.
Instead, I'd rather work smarter.
I prefer that damn <button>
. It gives me some accessibility for free. A real <button>
is already keyboard accessible. Screen readers already know what it is. It works with assistive tech out of the box. No extra code required.
The same goes for a <nav>
, <main>
, <article>
and just about every other semantic element. They tell browsers and assistive technologies exactly what the content is. They create landmark regions automatically. They provide structure that makes navigation possible for people using screen readers.
But no. Developers keep reaching for <div>
and <span>
for everything, then wonder why accessibility is so hard.
It's not hard. You're just making it hard.
Use semantic elements. Get accessibility built in. Stop reinventing the wheel when the wheel already works.