liveBook · Manning

Var element

As explained in Web Design Playground, Second Edition

The HTML var element marks a variable in a mathematical or programming expression and is commonly rendered in italics by default.

The HTML var element marks a word or phrase as a placeholder. Use it for a programming variable, a function parameter, or a term representing a general class of things. Browsers typically render the marked text in italics. section 16.1

Think of var as a small label that says, “This name stands in for something else.”

A placeholder inside syntax

In <code>&lt;time datetime="&lt;var&gt;machine-value&lt;/var&gt;"&gt;&lt;var&gt;human text&lt;/var&gt;&lt;/time&gt;</code>, var identifies the values that should be replaced with real data.

How Web Design Playground, Second Edition covers it

How deep it goes
Defines the element and its browser rendering, then demonstrates placeholder values without exploring implementation details.
Examples
Shows machine-value and human text placeholders inside time-element syntax.
What you can do after
Apply it via HTML markup to identify replaceable variables, parameters, and representative terms.
How it connects
Connects placeholders with programming variables, function parameters, and the time element.

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Web Design Playground, Second Edition. The section links point to the parts of the book it draws on.