Accessibility · Junior · Question 46 of 75
What does role="button" on a div give you?
- 1All the behaviour of a real
<button>element - 2The default visual styles of a native button
- 3Only the announcement; focus and keys are still on you
Show the answer
Correct answer: Only the announcement; focus and keys are still on you
Explanation
The role is a promise. Screen readers announce a button, so users expect it to work with Tab, Enter and Space, and you have to build all of that yourself.