Hacker News new | ask | show | jobs
by abellerose 1997 days ago
..
5 comments

You can use the ARIA role="button" attribute [1]. You also should make it focusable using tabindex="0" and allow keyboard input, although some screen readers might be able to get around those limitations...

But like another reply mentioned, you can get it all from free using a normal <button>, which isn't really hard to style even compared to a <div>, and provides it all for free...

[1] https://developer.mozilla.org/en-US/docs/Web/Accessibility/A...

I'm sorry if I made you feel that you should be ashamed of your lack of knowledge in this particular area. That wasn't my point at all. I'm just sad that we accessibility advocates have somehow not yet been able to reach you and other developers. I'm sorry you felt the need to retract your comment.
There is some progress though. EmberJS has lint rules to notify the developer when the using a div without role="button" among other things :)
> There should be a way to signal to browser a div will be used for a button or whatever and I believe people would be happy to use such a solution.

That solution already exists: replace "div" with "button"

I mean, this is exactly what aria attributes are for, right?
This already exists, and many developers don't use it.