3 ms·
..
by abellerose 6y ago
..
- scotth 6y agoI mean, this is exactly what aria attributes are for, right?
- deleted 6y ago[deleted]
- detaro 6y agoThis already exists, and many developers don't use it.
- Nicksil 6y ago> 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"
- deleted 6y ago[deleted]
- ratww 6y agoYou 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/ARIA/Roles/button_role https://developer.mozilla.org/en-US/docs/Web/Accessibility/A...
- mwcampbell 6y agoI'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.
- aspaviento 6y agoThere is some progress though. EmberJS has lint rules to notify the developer when the using a div without role="button" among other things :)