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>
Code it Online »

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

Attribute Value Description
for id Specifies one or more elements the output field relates to
form formid Specifies one or more forms the output field belongs to
name 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.


Have Any Suggestion? We Are Waiting To Hear from YOU!

Your Query was successfully sent!