W3-Video WEB Tutorials

w3-video.com is a Free eLearning Website with over 500 video tutorials on HTML5, XAMPP, .htaccess, Firefox, Notepad++

HTML5 Tutorial

Home HTML5 XAMPP .htaccess Firefox Notepad++


var ... ⁄var


Share it

var intro var browser display var parents - children var syntax

HTML5 var element

The var element allows you to mark up a variable. »video

(like variables in mathematics or programming OR any term ⁄symbol ⁄identifier ⁄.. that can act like a variable (holds a value) in other domains
Example: a term in a prose that acts like a placeholder represents a variable and can be marked using var element

About var

Display & support var

Firefox iconChrome iconIE iconOpera iconSafari icon

Parents, children var

Attributes var

Syntax var

1<var> ... </var> »video

Attributes and Values var (comma separated)

<varattribute="attribute_value(s)"> Video Examples
1. specific attributes
All Specific Attributes
2. global attributes
1.accesskey=keyboard key»img<var accesskey="h"> ... </var>
2.class=class name»html »img<var class="class_name"> ... </var>
3.contenteditable="",  , true, false »html<var contenteditable="true"> ... </var>
4.contextmenu=menu id value»html<var contextmenu="menu_id_value"> ... </var>
5.data-*= value -<var data-http-error="404"> ... </var>
6.dir=ltr, rtl, auto»html<var dir="ltr"> ... </var>
7.draggable= true,  , false»img<var draggable="false"> ... </var>
8.dropzone= copy, move, link, string:, file: -<var dropzone="copy"> ... </var>
9.hidden= "",  , hidden»html »img<var hidden="hidden"> ... </var>
10.id=id name»html »img<var id="unique_id_name"> ... </var>
11.itemid= URL --
12.itemprop= string »link »a-
13.itemref= string --
14.itemscope= "",  , itemscope--
15.itemtype= absolute URL --
16.lang=language code »html »head»title »img<var lang="en"> ... </var>
17.spellcheck="",  , true, false»html<var spellcheck="true"> ... </var>
18.style=CSS property:value»html »img<var style="color:red"> ... </var>
19.tabindex= integer »img<var tabindex="3"> ... </var>
20.title=text»html »link»style »abbr»dfn
»img »meter
<var title="html page"> ... </var>
21.translate="", yes, no»html »img<var translate="yes"> ... </var>
All Global Attributes
3. global event attributes
1.onclick=script» list<element onclick="script" > ...
2.ondblclick=script» list<element ondblclick="script" > ...
All Event Attributes

Video demonstration var element

HTML5 var element: mark up a variable

min video details
00:00 video tutorial: var element
00:04 var element allows you to mark up a variable
00:09 in this equation, x represents a variable

→ can be marked properly using var element
00:29 display in browser

For more information about the var element, please see the specs: W3CWHATWG