<output>

Forms

Represents the result of a calculation or user action. Semantically linked to inputs that contribute to its value.

Common Attributes

forformname

Example

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

About the <output> Element

The <output> HTML element belongs to the Forms category of HTML elements. Represents the result of a calculation or user action. Semantically linked to inputs that contribute to its value. Understanding when and how to use this element is essential for building well-structured, accessible, and SEO-friendly web pages.

The <output> element requires both an opening <output> and closing </output> tag. Content placed between these tags becomes the element's children. This element is part of the current HTML Living Standard and is supported in all modern browsers including Chrome, Firefox, Safari, and Edge.

Proper use of semantic HTML elements like <output> improves document structure, helps screen readers interpret content correctly, and provides signals to search engines about the purpose of different sections of your page. This leads to better accessibility scores, improved SEO rankings, and more maintainable code.

Related Elements