HTML <output> tag

HTML <output> tag is used to display the result of some calculation (performed by JavaScript) or the outcome of a user action (such as Input data into a form element).

The <output> tag is a newly added tag and was introduced in HTML5.

Syntax

Following are some specifications about the HTML <output> tag

DisplayInline
Start tag/End tagBoth Start and End tag
UsageForms and Input

Example

Test it Now

Output:

HTML output tag

Attribute:

Tag-specific attributes:

AttributeValueDescription
forelement_idIt specifies the list of other element's ids which indicates the relationship between the result of the calculation and the input elements.
formform_idIt specifies the form element to which this element is associated with.
namenameIt defines the name for the output element.

Global attribute:

HTML <output> tag supports the global attributes in HTML.

Event attribute:

HTML <output> tag supports the event attributes in HTML.

Supporting Browsers

Elementchrome browser Chromeie browser IEfirefox browser Firefoxopera browser Operasafari browser Safari
<output>YesYesYesYesYes