Output tag in HTML 5

Output tag in HTML 5 

 
The HTML <output> tag is used for displaying or showing the result of a calculation or operation, such as one performed by a script.
 
The <output> tag was first introduced in HTML 5.
 

Attributes

 
HTML tags contain one or more attributes.
 
There are 3 kinds of attributes that you can add to your HTML tags: Element-specific, global, and event attributes.
 
The attributes that you can add to this tag are listed below.
 

Element-Specific Attributes

 
The following table shows the attributes that are specific to the output tag in HTML 5.
 
Attribute Description
for Specifies one or more elements the output field relates to
form Specifies one or more forms the output field belongs to
name Specifies the name of this element.

 

Global Attributes

 
The following attributes are standard across all HTML 5 tags and hence are also applicable to the output tag.
 
Attribute Attribute Attribute
accesskey draggable style
class hidden tabindex
contenteditable id title
contextmenu lang  
dir spellcheck  
 
For a full explanation of these attributes, see HTML 5 global attributes.
 

Event  Attributes

 
Event attributes enable us to invoke a script from within your HTML. The script is invoked when a certain "event" occurs. Each event handler content attribute deals with a different event.
 
Here are the standard HTML 5 event handler content attributes which are also supported by the output tag.
 
Attribute Attribute Attribute
onabort onerror* onmousewheel
onblur* onfocus* onpause
oncanplay onformchange onplay
oncanplaythrough onforminput onplaying
onchange oninput onprogress
onclick oninvalid onratechange
oncontextmenu onkeydown onreadystatechange
ondblclick onkeypress onscroll
ondrag onkeyup onseeked
ondragend onload* onseeking
ondragenter onloadeddata onselect
ondragleave onloadedmetadata onshow
ondragover onloadstart onstalled
ondragstart onmousedown onsubmit
ondrop onmousemove onsuspend
ondurationchange onmouseout ontimeupdate
onemptied onmouseover onvolumechange
onended onmouseup onwaiting