HTML <output> Tag


The output tag is used to represent a calculation's outcome (like one performed by a script).

Syntax

 
<output> Results... </output>

Example

x
 
<!DOCTYPE html>
<html>
<body>
<form oninput="sumresult.value = parseInt(X.value) + parseInt(Y.value) + parseInt(Z.value)">
  <input type="number" name="X" value="25" /> +
  <input type="range" name="Y" value="0" /> +
  <input type="number" name="Z" value="15" />
  <br><br>
  Result: <output name="sumresult"></output>
</form>
</body>
</html>
Preview

Attributes

Attribute Value Description
for element-id Describes the relationship between the calculation's outcome and the elements that were used in the computation.
form form-id The form to which the output element belongs.
name name The output element's name is specified here.

Supported Browsers

Element Chrome Firefox Safari Edge / IE Opera
<output> 10.0 4.0 5.1 13.0 11.0