SpinTheMic
Pro

Interview practice question

A clickable div used as a button

Frontend Engineering · Accessibility · Beginner

A teammate built a "button" using a div with an onClick handler. What's wrong, and how do you fix it?

What a strong answer covers

Your AI report card counts how many of these ideas you cover.

  • Not focusable, no keyboard activation.
  • Not announced as button.
  • Replace with <button type="button">.
  • Reset styles via CSS.
  • Avoid recreating with ARIA unless necessary.
Practise this topic

Start without signing up. Sign in free to get an AI report card on your answer.

See all topics