This page is Almost Ready

Notice: The WebPlatform project, supported by various stewards between 2012 and 2015, has been discontinued. This site is now available on github.

output

Summary

The HTML <output> element represents the result of a calculation.

Overview Table

DOM Interface
HTMLOutputElement

The HTML <output> element represents the result of a calculation.

Attributes

  • for = unordered set of unique space-separated tokens
    Allows an explicit relationship to be made between the result of a calculation and the elements that represent the values that went into the calculation or that otherwise influenced the calculation.
    This attribute must have the value of an ID of an element in the same Document.
  • form = the ID of a form element in the element’s owner
    Associate the output element with its form owner.
    By default, the output element is associated with its nearest ancestor form element.
  • name = unique name
    Represents the element’s name.

Examples

<form oninput="result.value=parseInt(a.value)+parseInt(b.value)">
    <input type="range" name="b" value="50" /> +
    <input type="number" name="a" value="10" /> =
    <output name="result"></output>
</form>

Related specifications

HTML 5.1
W3C Working Draft
HTML 5
W3C Recommendation