HTML DOM Variable Object

Variable object

The Variable object represents the HTML <var> element.

Access Variable object

You can use getElementById() to access the <var> element:

var x = document.getElementById("myVar");

Try It Yourself

Create Variable object

You can use the document.createElement() method to create a <var> element:

var x = document.createElement("VAR");

Try It Yourself

Standard Properties and Events

Variable Object Supports StandardsPropertiesAndEvents.

Related Pages

HTML Tutorial:HTML Text Formatting Elements

HTML Reference Manual:HTML <var> Tag