EmmEEdu
HTML5 Standard & Document Object Model

HTML: Structure, Semantics & The DOM

HTML is not just tags on a screen—it forms the semantic foundation for search engine indexing, screen reader accessibility, and the living browser DOM tree.

HTML to DOM Tree Parser Visualizer

Browser Engine

Watch raw HTML text tokenized into an active hierarchical Document Object Model tree.

Raw HTML Source
UTF-8 String
<!DOCTYPE html>
<html lang="en">
  <head>
    <title>EmmE Edu Article</title>
  </head>
  <body>
    <header class="site-header">
      <h1>Web Development Atlas</h1>
    </header>
    <main>
      <article>
        <h2>Understanding the DOM</h2>
        <p>The DOM turns HTML text into an interactive object tree.</p>
        <button id="learn-btn">Read More</button>
      </article>
    </main>
  </body>
</html>
Byte stream -> Tokenizer -> Tree Builder
Hierarchical DOM Tree
Click node to inspect
Living in RAM as C++ / Rust DOM Nodes
DOM Node Inspector
NODE NAME:HTML
NODE TYPE:1 (ELEMENT_NODE)
ATTRIBUTES:
lang:"en"
CHILD NODES COUNT:2
JavaScript can target this node via document.querySelector(...)
Accessibility & SEO

Semantic HTML Elements

Using meaningful semantic tags instead of generic <div> tags communicates intent to screen readers and web crawlers.

<header>

Introductory content or navigational links for a page or section.

<nav>

Major navigation blocks (screen readers recognize this as a landmark).

<main>

Dominant content unique to this document. Exactly one per page.

<article>

Self-contained composition that makes sense independently (blog post, card).

<section>

Thematic grouping of content, typically with an introductory heading.

<aside>

Content tangentially related to the content around it (sidebar, callout).

<footer>

Closing metadata, copyright, author info, or related links.

Anti-Patterns to Avoid
  • • Using <div onClick=...> instead of real accessible <button> elements (breaks keyboard Enter/Space triggers).
  • • Skipping image alt="" attributes, blinding screen reader users.
  • • Using multiple <h1> tags per document, breaking SEO hierarchy.
Best Practices
  • • Always associate <label for="id"> with corresponding form inputs.
  • • Include proper viewport metadata: width=device-width, initial-scale=1.
  • • Set <html lang="en"> to enable accurate voice synthesizer translation.