English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية

HTML Reference Manual

Complete List of HTML Tags

HTML: <output> tag

The HTML <output> tag represents the result of a calculation or user operation.

Online Example

Display the calculation result in the <output> element:

<!DOCTYPE html>
<html>
<head> 
<meta charset="utf-8"> 
<title>Basic Tutorial(oldtoolbag.com)</title>/title> 
</head>
<body>
<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"></output>
</form>
<p><strong>Attention:/Internet Explorer does not support the output tag./p>
</body>
</html>
Test and See ‹/›

Browser Compatibility

IEFirefoxOperaChromeSafari

Firefox, Opera, Chrome, and Safari browsers all support the <output> tag.

Note: Internet Explorer browser does not support the <output> tag.

Tag Definition and Usage Description

<output> tag is used to display the result of a calculation as output (such as the output of executing a script).

in HTML 4.01 from HTML5differences

<output> is a tag in HTML 5 in the new tag.

Attribute

AttributeValueDescription
forHTML5element_idDescribe the relationship between the elements used in the calculation and the calculation result.
formHTML5form_idDefine one or more forms that the input field belongs to.
nameHTML5nameDefine a unique name for an object (used when submitting a form).

Global Attributes

<output> tag supports global attributes, see the complete attribute table HTML Global Attributes.

event attributes

<output> tag supports all HTML Event Attributes.