Parsing HTML → DOM
The browser reads HTML top to bottom, tokenizes the tags, and builds the DOM (Document Object Model) — a tree of nodes representing the page's structure and content.
<p>Hi</p> becomes a paragraph node with a text child.
<html>
<body>
<p>Hi</p>
html
body
p
"Hi"