What is HTML?
HTML (HyperText Markup Language) is not a programming language; it's a markup language. It uses tags to label content (like "heading," "paragraph," "link") so the browser knows how to display it and what role it plays.
Every piece of text, every image, and every link on the web exists inside an HTML tag. This tagged structure is then translated by the browser into the Document Object Model (DOM).
The Document Object Model (DOM)
The DOM is the browser's internal, tree-like representation of your HTML document. When JavaScript interacts with a webpage—say, hiding a menu or changing text—it's actually interacting with the DOM.
Example: Simple HTML vs. the DOM
<body>
<header>
<nav>...</nav>
</header>
</body>
The browser reads this, creates nodes for `body`, `header`, and `nav`, and connects them in a hierarchy that code can easily traverse.