THE WORLD'S LARGEST WEB DEVELOPER SITE
HTMLCSSJAVASCRIPTSQLPHPBOOTSTRAPJQUERYANGULARXML
 

HTML DOM Variable Object


Variable Object

The Variable object represents an HTML <var> element.

Access a Variable Object

You can access a <var> element by using getElementById():

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

Create a Variable Object

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

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