The <output> element is a container for a calculation result or the outcome of a user action. Apps usually update it with JavaScript when <input> values change.
Point for at the contributing control ids, and optionally set name or form to associate it with a <form>. The output’s content is not submitted with the form.
Baseline · Widely available.
Core <output> support has been widely available across browsers since about October 2018.
Accessibility note.
Many browsers treat <output> as a live region (role status), so result updates can be announced without moving focus. Prefer plain text inside it.
Syntax
HTML Syntax
syntax.html
<output for="id-list">result</output>
Both start and end tags are required. Content is phrasing content (usually text you update from script).
Reference
Attributes
The attributes you will use most often on <output>:
Multiply (or otherwise compute) in script on input.
Keep the announced text short so live-region updates stay clear.
Edge Cases & Pitfalls
Most surprises come from expecting output to submit, or from forgetting to update it in script.
forms
Not submitted
Output name and contents are left out of form posts. Persist the real inputs (or compute again on the server).
for
for does not calculate
It documents relationships. You still write the math in JavaScript (or oninput).
a11y
Keep live text simple
Announcements are usually plain text. Avoid stuffing links or complex widgets inside output.
types
Coerce numbers
Input values are strings. Use Number(...) or valueAsNumber before adding.
naming
Prefer output over span
For form results, <output> carries clearer semantics than a generic <span>.
Compatibility
Browser Support
The <output> element is core HTML form UI in modern browsers. It is not a Node.js, Deno, or Bun API.
✓ Baseline · Widely available
<output>
Widely available since about October 2018. Chrome, Firefox, Safari, Edge, and Opera support output, including for/form/name associations.
96%Global support (approx.)
Google ChromeAll modern
Full support
Mozilla FirefoxAll modern
Full support
Apple SafariAll modern
Full support
Microsoft EdgeAll modern
Full support
OperaAll modern
Full support
Samsung InternetAll modern
Full support
Internet ExplorerNo
Not supported
<output>Widely supported
Bottom line: Safe for modern sites. Update results with script, and never rely on output being submitted.
Remember
Key Takeaways
Role:<output> shows a calculation or action result.
Wire: use for to list contributing control ids; update with script.
Forms: content is not submitted; associate with form if needed.
Access: label it and keep announced text plain.
One line: put live results in <output>, compute them in script, submit the inputs.
UA style
Default CSS Settings
User agents typically treat output as inline phrasing content:
default.css
output {
display: inline;
}
Style it lightly for emphasis if needed. Do not remove focus outlines from related controls.
Frequently Asked Questions
The output element is a container for a calculation result or the outcome of a user action — for example the sum of two inputs shown live as the user changes values.
No. The output element’s name and contents are not included in form submission. Submit the underlying inputs if the server needs those values.
for lists space-separated id values of controls that contributed to the result. It documents the relationship for authors and assistive tech; it does not calculate anything by itself.
Use JavaScript (or a form oninput handler) to set the element’s textContent or the .value property when inputs change.
Many browsers expose output as a live region (implicit role status), so result changes can be announced without moving focus. Keep the content plain and clear.
Prefer output when the text is a form-related result. It is labelable, form-associated, and conveys intent better than a generic span.