HTML <output> attribute

Definition and Usage

for The attribute specifies the relationship between the calculated result and the elements used in the calculation.

Example

Perform the calculation and display the result in the <output> element:

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

Try It Yourself

Syntax

<output for="element_id">

Attribute Value

Value Description
element_id Specifies a list of one or more elements separated by spaces, indicating the relationship between the calculated result and the elements used in the calculation.

Browser Support

The numbers in the table indicate the first browser version to fully support this attribute.

Chrome Edge Firefox Safari Opera
Chrome Edge Firefox Safari Opera
10.0 13.0 4.0 7.0 11.5