←back to thread

Just use a button

(gomakethings.com)
285 points moebrowne | 2 comments | | HN request time: 0.423s | source
Show context
randyrand ◴[] No.45775197[source]
> This element does not announce itself as an interactive element to screen reader users

Are you sure? Screen readers should be able to detect a div with a onclick as interactable, no? And if they can’t, that seems like an exceedingly simple fix. I’d be shocked if they can’t already detect onclick.

replies(2): >>45775278 #>>45775700 #
rictic ◴[] No.45775278[source]
A click handler can be doing a lot of things that aren't much like a button, like letting you close a modal if you click outside of it, capturing mouse events for a game, or passively recording events for analytics. All that a click handler tells you is that there's some code that sometimes cares about some clicks somewhere inside that element.
replies(2): >>45775493 #>>45776048 #
1. randyrand ◴[] No.45776048[source]
All of those seem like examples of things you’d want your screen reader to tell you about.
replies(1): >>45777730 #
2. zahlman ◴[] No.45777730[source]
Sure.

What is the screen reader's plan for determining the purpose of the attached JavaScript?