HTML & CSS · Middle · Question 71 of 75
What is needed to make <div role="button"> behave like a real button?
- ✓Correct answer:
tabindex="0"and handling Enter and Space keys - which is why a native<button>is better - 2Nothing;
role="button"adds all behavior - 3Only
cursor: pointer
Explanation
ARIA changes what assistive tech announces, not behavior. A <button> is focusable, activates with keyboard and works with forms out of the box.