HTML <output> Tag


The <output> HTML tag is used to represent the result of a calculation or a user's input within the context of a mathematical or computational operation. It is a semantic HTML5 element that helps provide structure and meaning to the content on a web page. Typically, <output> tags are used in conjunction with other HTML elements, such as <form> elements and JavaScript, to display the outcome of calculations or user interactions, making it easier for both users and developers to understand and manipulate data on a webpage.


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


<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>


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

The following table will show you the current browser support for the HTML <output> tag.

Edge Chrome Firefox Opera Safari
Tablets / Mobile
Chrome Firefox Opera Safari Samsung Webview

Last updated by CSSPortal on: 30th March 2024