HTML <output>Tag


Examples

Display the calculation result in the <output> element:

<form oninput="x.value=parseInt(a.value)+parseInt(b.value)">0 <input type="range" id="a" value="50">100 +<input type="number" id="b" value="50"> =<output name="x" for="a b"></output>

Try it yourself »

Browser Support

The numbers in the table indicate the first browser version that fully supports the attribute.

Element
<output> 10.0 13.0  4.0 5.1 11.0

Tag Definition and Usage Instructions

The <output> tag is used to display the output of a calculation (such as the output from a script).


Differences between HTML 4.01 and HTML5

The <output> tag is new in HTML5.


Attributes

New: HTML5 new attribute.

Attribute Value Description
forNew element_id Describes the relationship between the elements used in the calculation and the calculation result.
formNew form_id Defines one or more forms to which the input field belongs.
nameNew name Defines a unique name for the object (used when submitting a form).

Global Attributes

The <output> tag supports global attributes. View the full attribute tableHTML Global Attributes。


Event Attributes

The <output> tag supports allHTML Event Attributes。

Other Extensions