Semantic HTML Examples - Interactive Demo

This document provides interactive demonstrations of the code examples from the article "From <div> Hell to SEO Heaven". Click on the elements to see their behavior and observe the structural differences.


Example 1: The Button

1. The <div> Nightmare

This uses a generic div to mimic a button. Try clicking it, or tabbing to it (you can't without custom JS!), or pressing enter on it.

Submit (Div)

2. The <div> with a Life Vest

A div with ARIA attributes to improve accessibility. You can tab to it and press Enter/Space.

Submit (ARIA Div)

3. The Best Practice (Semantic HTML)

A native <button> element. Accessible and functional out-of-the-box.


Example 2: A Product Card

1. The <div> Nightmare

A cool product
Amazing Product (Div)
This product is amazing, built with non-semantic elements.
Read More

2. The <div> with a Life Vest

An accessible product
Amazing Product (ARIA Div)
This product is amazing, now with ARIA attributes.
Read More

3. The Best Practice (Semantic HTML)

A semantic product

Amazing Product (Semantic)

This product is amazing, built with semantic HTML.

Read More

Example 3: Modal Navigation

Click the buttons below to open each version of the modal. Try navigating with a keyboard (Tab key) and observe the differences.