Description

The <output> element represents the result of a calculation. Typically this element defines a region that will be used to display text output from some calculation that is usually performed by a client-side script (usually JavaScript).

The following table summarizes the usages context and the version history of this tag.

Placement:Inline
Content:Inline and text
Start/ End Tag:Start tag: required, End tag: required
Version:HTML 5

Syntax

The basic syntax of the <output> tag is given with:

HTML/XHTML: <output> ... </output>

The example below shows the <output> tag in action.

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

Tag-Specific Attributes

The following table shows the attributes that are specific to the <output> tag.

Global Attributes

Like all other HTML tags, the <output> tag supports the glodelal Attributes in HTML5.

Event Attributes

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

Browser Compatibility

Element
<output>YesYesYesYesYes