HTML <var> tag
The <var> tag is used to declare variable text.
Standard attributes
class, dir, id, lang, style, title, xml:lang
For more information on standard attributes, check out our HTML standard attributes reference page.
Event attributes
onclick, ondblclick, onmousedown, onmousemove, onmouseout, onmouseover, onmouseup, onkeydown, onkeypress, onkeyup
For more information on event attributes, check out our HTML event attributes reference page.
Example
initSum = 15
What is the name of the variable? <var>initSum</var>
What was that Javascript code again?
document.write("Hello " + <var>name</var> + "!")
Output:
initSum = 15
What is the name of the variable? initSum
What was that Javascript code again?
document.write("Hello " + name + "!")