HTMLWhat Is HTML?

What Is HTML?

In the introduction you saw what HTML does. Now let's get precise about what it is — because a lot of confusion in web development traces back to conflating HTML with "programming," or not knowing the difference between a tag, an element, and an attribute.

A markup language, not a programming language

HTML has no variables, no loops, no functions, no conditionals, and no way to perform calculations. It cannot ask "if the user is logged in, show this" — that requires a real programming language like JavaScript. HTML simply describes content: "this text is a heading," "this text is a paragraph," "this text links to another page."

HTML (markup)

JavaScript (programming)

Purpose

Describes structure and meaning

Defines logic and behavior

Has variables/loops?

No

Yes

Can make decisions?

No

Yes (if/else, etc.)

Executed by

Parsed into a tree (the DOM)

Interpreted/compiled and run

Analogy

A recipe's ingredient list

The steps that cook the meal

Markup languages you may have heard of
HTML is one of several markup languages. Others include Markdown (used for this very tutorial's prose formatting), XML, and LaTeX. They all share the idea of annotating plain text with meaning rather than executing instructions.
The core vocabulary: elements, tags, and attributes

These three words get used constantly, and beginners often mix them up. Take this line of HTML:

HTML
<a href="https://example.com">Click here</a>
  • A tag is the markup itself, wrapped in angle brackets: <code><a></code> is the opening tag, <code></a></code> is the closing tag.

  • An element is the whole package — the opening tag, the content inside, and the closing tag together. <code><a href="...">Click here</a></code> is one element.

  • An attribute is extra information placed inside the opening tag. Here, <code>href="https://example.com"</code> is an attribute that tells the browser where the link should go.

Precise language helps you communicate
Saying "the anchor element" instead of "the link tag thingy" makes you easier to understand in code reviews, documentation, and job interviews. It's a small habit that pays off quickly.
How HTML relates to the DOM

When a browser loads an HTML file, it doesn't keep the raw text around — it parses it into a tree-like, in-memory structure called the DOM (Document Object Model). Every element becomes a node in that tree, with parent/child relationships that mirror the nesting in your HTML.

HTML
<body>
  <h1>Title</h1>
  <p>Some text</p>
</body>

That snippet becomes a tree where <body> is the parent of two children, <h1> and <p>. JavaScript then reads and modifies this tree — not the original HTML text — to make pages interactive. This is why people say "HTML produces the DOM": the source code and the live, in-memory structure are related but distinct.

Why this distinction matters
Tools like DevTools' Elements panel show you the *current DOM*, which can differ from the original HTML source if JavaScript has changed anything since the page loaded. "View Source" shows the original file; the Elements panel shows the live tree.
A quick tour of HTML's versions

HTML has evolved considerably since it first appeared. You'll mostly write HTML5 today, but it helps to recognize the names you might encounter in older codebases or job postings.

Version

Era

Notable characteristics

HTML 4.01

Late 1990s

Introduced strict vs transitional doctypes; heavy use of tables for layout was common practice at the time

XHTML 1.0/1.1

Early 2000s

HTML rewritten as strict XML — every tag had to be closed and lowercase; unforgiving of small errors

HTML5

2014 (and ongoing)

Native semantic elements (<code><section></code>, <code><article></code>), audio/video without plugins, forgiving parsing rules, and continuous updates as a "living standard"

The full story of why HTML changed shape over the decades — including the split between two standards bodies — is covered in the next page on history.

Key takeaway: HTML describes what content is, the browser turns that description into the DOM, and CSS/JavaScript then style and animate that living structure. Next, we'll look at where HTML actually came from.