HTML · The document layer

What are the most common HTML mistakes you see?

Hardcommon mistakessemanticsaccessibilityUpdated Oct 2026
Quiz this track

Short answer

Common HTML mistakes include div soup instead of semantic elements, missing or useless alt text, inputs without labels, buttons without a type, duplicate ids and skipped heading levels.

Most HTML mistakes are not parser errors. The page renders, but the structure is unclear to assistive technology and fragile for maintainers. These are the patterns I look for in review.

The usual suspects

  • Using divs for buttons, links, navigation and headings
  • Omitting alt text or writing alt=image
  • Using placeholder text instead of a label
  • Forgetting type=button on non-submit buttons inside a form
  • Duplicating ids, which breaks labels, anchors and ARIA references
  • Skipping heading levels for visual size
  • Using tables for layout or clickable divs for navigation
html
<!-- Fragile -->
<div class="btn" onclick="save()">Save</div>
<input placeholder="Email" />

<!-- Correct -->
<button type="button" onclick="save()">Save</button>
<label for="email">Email</label>
<input id="email" name="email" type="email" />

Another frequent problem is hiding content with display:none when it should remain available to assistive technology, or the reverse: using aria-hidden on something focusable. Visibility and accessibility tree membership are separate decisions.

Validate the HTML, run an accessibility audit and test with a keyboard. Many of these mistakes are invisible in a screenshot but obvious the moment you navigate without a mouse.

Follow-ups you should expect

Interviewers use these to check whether the first answer was understanding or memorisation.

  1. 1Why is div soup a problem if the page looks fine?
  2. 2What breaks when ids are duplicated?
  3. 3Why is the default button type dangerous in a form?
  4. 4How would you audit a page for these mistakes?

Say it in the interview

The mistakes I see most are div soup, missing or meaningless alt text, inputs without labels, buttons without a type inside forms, duplicate ids and skipped heading levels. They usually do not break rendering, which is why they survive review, but they break keyboard navigation, screen reader output and maintainability. I catch them with HTML validation, an accessibility audit and actually tabbing through the page. Native elements and unique ids prevent most of them.

Use this as a model, not a script. Saying it in your own words is what makes it survive follow-up pressure.

Related questions

Reading is step one

Now say it out loud.

Understanding an answer and delivering it under pressure are different skills. Rehearse this topic in a live HTML mock interview and get scored feedback on depth, clarity and confidence.