VOOZH about

URL: https://www.geeksforgeeks.org/html/html-var-tag/

⇱ HTML var Tag - GeeksforGeeks


  • Courses
  • Tutorials
  • Interview Prep

HTML var Tag

Last Updated : 28 May, 2026

The <var> tag in HTML is used to define a variable. It is typically used to represent a variable in a mathematical expression or a placeholder that can be updated dynamically with JavaScript

The content inside <var> tag is often styled differently by browsers to indicate that it is a variable, though this can be customized with CSS.

Syntax:

<var> Contents... </var>

Other elements that are used in contexts in which <var> are commonly used include:

Tags

Description

<code>

It displays computer code in a monospaced font.

<kbd>

It represents user input like keyboard keys.

<samp>

It shows example output from programs.

<em>

Italicizes text for emphasis or stress.

Example: Implementation of var tag with help of another example.

Comment