<output>


HTML <output> Tag

Instance

<!DOCTYPE html>
<html>
<head> 
<meta charset="utf-8"> 
<title>php中文网(php.cn)</title> 
</head>
<body>

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

<p><strong>注意:</strong>  Internet Explorer 不支持 output 标签。</p>

</body>
</html>

Run Example»

Click the "Run Instance" button to view the online instance

Browser support

1000.png

##Firefox, Opera, Chrome and Safari browsing All browsers support the <output> tag.

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


Tag definition and usage instructions

<output> The tag is displayed as the output of the calculation result (such as the output of the execution script).


Differences between HTML 4.01 and HTML5

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


Attributes

New: HTML5 new attributes.

AttributesValueDescriptionforDescribes the relationship between the elements used in the calculation and the calculation result. form Define one or more forms to which the input fields belong. name Define the unique name of the object (used when submitting the form) .
New element_id
Newform_id
Newname
Global attributes

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


Event attributes

<output> tag supports all HTML event attributes.