Widely availableSupported across all major browsers. Safe to use in production.

Overview

The <var> element represents the name of a variable in a mathematical expression or a programming context.

Browser support

Feature Desktop Mobile
Chrome
Edge
Firefox
Safari
Chrome Android
Safari iOS
1
12
1
≤4
18
≤3.2
1+Supported (version) Not supported Has note Sub-feature descriptions sourced from MDN Web Docs (CC BY-SA 2.5)

Syntax

HTML
<p>Find the value of the area: `<var>l</var> × <var>w</var>`</p>
<p><var>x</var> Find the value of the following expression.</p>

Live demo

variable. Display

Var element in number notation or programu. variablename representationation.

PreviewFullscreen

co-dinside. variable

programing. context in variablename show.

PreviewFullscreen

Var and code. Compare Usage

Var is variable, code is co-d.usage. Difference comparison.

PreviewFullscreen

Use cases

  • Using <var>

    The <var> element represents the name of a variable in a mathematical expression or a programming context.

Cautions

  • May not be supported in older browsers.

Accessibility

  • Verify how this element is announced by screen readers.

Powered by web-features