Skip to the page

Accessibility · Write code

Semantic HTML and why it matters

The interviewer asks

Why use semantic HTML? Fix this markup: a div with an onclick used as a button, a div soup header, and an image without alt text.

Then

Follow-ups the interviewer asks next

  1. What do you get for free with <button> that a div lacks? (Focus, Enter/Space activation, role.)
  2. Landmarks (header, nav, main, footer) and heading hierarchy.
  3. When is alt="" correct?
  4. The first rule of ARIA.

The answer

What a strong answer covers

  • Accessibility, SEO, maintainability, built-in keyboard support
  • Native elements before ARIA
  • Labels for every form control

The red pen

Common traps

Avoid:role="button" on a div without tabindex or key handlers.

Practise this out loud

Say your answer out loud to an AI interviewer that follows up, and get a score for it.

Practise by voice

Practise questions like this out loud

Sign up and start with a 15-minute interview with the full report, and an English conversation. No card needed.

Start your free interview