Description

The <var> (short for variable) tag is used to indicate that the text is an instance of a variable or program argument.

The following table summarizes the usages context and the version history of this tag.

Placement:Inline
Content:Inline and text
Start/ End Tag:Start tag: required, End tag: required
Version:HTML 2, 3.2, 4, 4.01, 5

Syntax

The basic syntax of the <var> tag is given with:

HTML/XHTML: <var> ... </var>

The example below shows the <var> tag in action.

<p>A simple equation: <var>x</var> = <var>y</var> + 2 </p>

Tag-Specific Attributes

The <var> tag doesn't have any specific attribute.

Global Attributes

Like all other HTML tags, the <var> tag supports the glodelal Attributes in HTML5.

Event Attributes

The <var> tag also supports the event Attributes in HTML5.

Browser Compatibility

Element
<var>YesYesYesYesYes