4 ms·
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
by paulhebert 7y ago
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.