Get the latest tech news

Just use a button


One of the weirdest “debates” I seem to perpetually have with framework-enthusiastic developers is whether or not a <div> is “just as good” as a <button>. Spoiler: it’s not. Let’s dig in. The problem Among the React crowd, and also among people who seem to enjoy HTMX, I see a lot this… <div onclick="showSignIn()"> Open Modal </div>function showSignIn () { // Code to show the sign-in modal. // The details of what happens here vary by stack.

None

Get the Android app

Or read this on Hacker News

Read more on:

Photo of button

button

Related news:

News photo

YouTube's new 'Like' button animations bring a playful twist to your viewing experience

News photo

Nothing Phone 3, 3a series rolls out call recording at the push of a button

News photo

Google Temporarily Pauses AI-Powered 'Homework Helper' Button in Chrome Over Cheating Concerns