HTML
HTML is the markup language that gives a web page its structure. It tells the browser which pieces of content are headings, links, images, form fields, and other elements.
What HTML does
HTML stands for HyperText Markup Language. It describes what content is, not just what it looks like. For example, a line of text styled to look large and bold is not necessarily a heading. Marking it up as <h1> gives it a heading role, which lets screen reader users find it through heading navigation. CSS controls presentation, and JavaScript can add behavior or update the page. Some interactions, such as following a link, are already built into HTML elements.
From markup to the DOM
In <a href="/help">Help</a>, the opening and closing tags enclose the link text, while the href attribute supplies the destination. Not every element comes in a pair: <img> and <input> are void elements, so they cannot contain content and have no closing tag.
The browser parses the markup into the Document Object Model (DOM), a tree that JavaScript can read and change. The tree need not exactly match the source. For instance, the parser can insert a <tbody> around table rows even when the source does not include one. If a script then adds a row, it will appear in the live DOM without changing the original HTML response.
Example: a search form
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Search the catalog</title>
</head>
<body>
<main>
<h1>Search the catalog</h1>
<form action="/search" method="get">
<label for="query">Search terms</label>
<input id="query" name="q" type="search">
<button type="submit">Search</button>
</form>
</main>
</body>
</html>
The doctype tells the browser to use standards mode. The label's for matches the input's id, so the browser can use the label as the field's accessible name. The input's name serves a different purpose: it becomes the key in the submitted data. Entering html and submitting this form sends a GET request to /search?q=html without a script.
Where it matters in practice
Whether you author a static page, render a template on the server, or build a page with a frontend framework, the choice of element affects how people use it. A native <button> can receive keyboard focus and be activated with Enter or Space. Adding a click handler to a <div> does not give it those behaviors. Use a link for navigation, a button for an action, and CSS to make either one fit the design.
What interviewers look for
A typical exercise is to turn a small design into usable markup. Be ready to explain how the headings organize the page, how each form field gets a label, and which interactions the browser handles without custom code.
“HTML” questions from real interviews
Asked at 85 companies