HTML5 <output> Tag

Example

How to use the output element in a form:

<input name="numa" type="number"> +
<input name="numb" type="number"> =
<output name="result"
onforminput="value=numa.valueAsNumber + numb.valueAsNumber"></output>

Try it yourself »

Definition and Usage

The <output> tag represents the result of a calculation (like one performed by a script).


Differences Between HTML 4.01 and HTML5

The <output> tag is new in HTML5.


Attributes

New : New in HTML5.

Attribute Value Description
forNew id Specifies one or more elements the output field relates to
formNew formid Specifies one or more forms the output field belongs to
nameNew name Specifies a name for the object (to use when a form is submitted)

Standard Attributes

The <output> tag also supports the Standard Attributes in HTML5.


Event Attributes

The <output> tag also supports the Event Attributes in HTML5.