Tutorials

KodeKite Tools

HTML
Flexbox
SVG
Canvas
HTML Tutorial

More


HTML Var Element
Var Element

HTML var element defines variable and is used to display programming or mathematical variables.

Syntax

<var>Content</var>

Or

<tag><var>Content</var></tag>


You can apply var element to any element and use any where within a HTML document.


Example

x + y = 5

Var is a pair tag and output of var element is italic text like you can see in above example.


Practice Task

Open notepad or any other text editor, follow the following points.


  • Select some mathematical formulae or programming code
  • Use <var> element to write their variables only

save file with name task.html or task.htm and then open it using any browser and see results.


Solution

int x = y = 5, z = 7;

Don't forget var is non empty element which means it always comes in pair.