HTML <output> Tag
Definition and Usage
<output>
The tag is used to represent the result of a calculation (for example, a calculation performed by a script).
See also:
HTML DOM Reference Manual:Output Object
Instance
Execute the calculation and <output>
Display the result in the 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>
Attribute
Attribute | Value | Description |
---|---|---|
for | Element id | Specifies the relationship between the calculation result and the elements used in the calculation. |
form | Form id | Specifies the form to which the output element belongs. |
name | Name | Specifies the name of the output element. |
Global Attributes
<output>
The tag also supports Global Attributes in HTML.
event attributes
<output>
The tag also supports Event Attributes in HTML.
Default CSS Settings
Most browsers will use the following default values to display <output>
Element:
output { display: inline; }
Browser Support
The numbers in the table indicate the first browser version to fully support this tag.
Chrome | Edge | Firefox | Safari | Opera |
---|---|---|---|---|
Chrome | Edge | Firefox | Safari | Opera |
10.0 | 13.0 | 4.0 | 5.1 | 11.0 |