HTML · The document layer
What are the most common HTML mistakes you see?
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
<!-- 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.
Follow-ups you should expect
Interviewers use these to check whether the first answer was understanding or memorisation.
- 1Why is div soup a problem if the page looks fine?
- 2What breaks when ids are duplicated?
- 3Why is the default button type dangerous in a form?
- 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.