Latest web development tutorials

HTML <output> tag

Examples

The results appear in the <output> element:

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

try it"

Browser Support

Internet ExplorerFirefoxOperaGoogle ChromeSafari

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

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


Tag definitions and instructions

<Output> tag as the calculation result output display (such as the output of the execution of the script).


Differences in the HTML 4.01 and HTML5

<Output> tag is new in HTML 5 tag.


Attributes

New: HTML5 new property.

属性 描述
for New element_id 描述计算中使用的元素与计算结果之间的关系。
form New form_id 定义输入字段所属的一个或多个表单。
name New name 定义对象的唯一名称(表单提交时使用)。

Global Properties

<output> tag supports the global attributes, view complete the property sheet HTML Global Attributes .


Event Properties

<output> tag supports all HTML event attributes .