Accessible Semantic HTML: Building on Native Elements
Semantic HTML gives you roles, states, and keyboard behaviors for free. Learn how to avoid div-soup anti-patterns.
Key Takeaways
- Use <button> for actions and <a href> for navigation.
- Wrap page sections in landmarks (<header>, <nav>, <main>, <footer>).
- Always set <html lang='...'> and a descriptive <title>.
Native Buttons vs. Clickable Divs
A native <button> participates in Tab order, fires on both Enter and Space, supports disabled states, and announces as 'button'. Rebuilding all of that on a <div> takes dozens of lines of fragile ARIA and JavaScript.
Use native interactive tags
<div class="btn" onclick="save()">Save</div><button type="button" onclick="save()">Save</button>Frequently Asked Questions
Interactive Tools for This Guide
HTML Accessibility Checker
Comprehensive local HTML audit with DOM structural checks, optional axe-core scan, and before/after preview.
Semantic HTML Checker
Spot clickable <div> elements, missing landmarks, and non-semantic markup patterns.
Semantic HTML Code Generator
Generate an accessible HTML5 page skeleton with landmarks, skip link, and headings.
Continue Reading
Heading Hierarchy & HTML5 Landmarks: Structuring Pages Cleanly
Combine logical H1–H6 headings with labeled landmarks so assistive technology users can scan any page in seconds.
Accessible Forms & Labels: Error Handling, Hints & Autocomplete
Eliminate form friction with explicit <label> associations, non-disappearing instructions, and accessible inline validation.