Just use a button
This title could be clearer and more informative.Try out Clickbait Shieldfor free (5 uses left this month).
Using `<div>` elements with click handlers instead of `<button>` elements creates accessibility problems for screen reader and keyboard users. While you can add `role="button"`, `tabindex`, and keyboard event listeners to make a `<div>` behave like a button, this recreates functionality that `<button>` provides natively. The
Table of contents
The problem #The “fixes” aren’t #You’ve just recreated all of the functionality a <button> gives you for free #13 Comments
Sort: