The HTML Output element (<output>) is a container element into which a site or app can inject the results of a calculation or the outcome of a user action.
| Content categories | Flow content, phrasing content, listed, labelable, resettable form-associated element, palpable content. |
|---|---|
| Permitted content | Phrasing content. |
| Tag omission | None, both the starting and ending tag are mandatory. |
| Permitted parents | Any element that accepts phrasing content. |
| Permitted ARIA roles | Any |
| DOM interface | HTMLOutputElement |
This element includes the global attributes.
forformnameThis form provides a slider whose value can range between 0 and 100. and an <input> element into which you can enter a second number. The two numbers are added together and the result is displayed in the <output> element each time the value of any of the controls changes.
<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">60</output>
</form>
| Specification | Status | Comment |
|---|---|---|
| HTML Living Standard The definition of '<output>' in that specification. | Living Standard | |
| HTML5 The definition of '<output>' in that specification. | Recommendation |
| Feature | Chrome | Edge | Firefox | Internet Explorer | Opera | Safari |
|---|---|---|---|---|---|---|
| Basic support | 10 | Yes | 4 | No | 11 | 7 |
for |
10 | Yes | 4 | No | 11 | 7 |
| Feature | Android webview | Chrome for Android | Edge mobile | Firefox for Android | IE mobile | Opera Android | iOS Safari |
|---|---|---|---|---|---|---|---|
| Basic support | Yes | Yes | Yes | 4 | No | ? | Yes |
for |
Yes | Yes | Yes | 4 | No | ? | Yes |
<form>, <input>, <button>, <datalist>, <legend>, <label>, <select>, <optgroup>, <option>, <textarea>, <keygen>, <fieldset>, <progress> and <meter>.
© 2005–2018 Mozilla Developer Network and individual contributors.
Licensed under the Creative Commons Attribution-ShareAlike License v2.5 or later.
https://developer.mozilla.org/en-US/docs/Web/HTML/Element/output