HTML <output> Tag

Description

The <output> HTML element is used for representing the result of a calculation, such as one performed by a script.

Properties

Permitted Parents
Any element that accepts phrasing content
Content
Inline and text
Start/End Tags
Start tag: required, End tag: required

Example

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

Attributes

Attribute Definition
for Specifies the relationship between the result of the calculation, and the elements used in the calculation
form Associates the output with a form
name Specifies the name of this element

Global Attributes

The <output> tag also supports the Global Attributes in HTML5

Event Attributes

The <output> tag also supports the Event Attributes in HTML5

Browser Support

Desktop
Explorer Edge Chrome Firefox Opera Safari
XYes104117
Tablets / Mobile
Android Chrome Firefox Opera Safari Samsung
YesYes4XYesYes

Last updated by CSSPortal on: 6th December 2019