News for hackers. Stuff that matters.
Re:HTML is the Web by paulhebert on Wednesday June 26, 2019 @11:59AM (#20286218)
Using a button here would be more appropriate for a few reasons:

Buttons by default have keyboard support for focusing and clicking. You’d have to manually add this to a div.

Screenreaders, scrapers, and other automated tools reading your html understand buttons and treat them differently from divs.

It’s easier for other devs to understand your code at a glance if clickable elements are buttons.

There are no comments on this comment yet.