Summary -
In this topic, we described about the <output> tag along with detailed example.
The <output> tag was introduced in HTML 5. Displays the Result of the calculation or user action. The <output> tag is used for representing the result of a calculation or a user action.
The tag can be specified like <output for="" name=""></output>. Any textual content in <output> tag will define its initial value.
Syntax -
<output>….</output>
Optional Attributes -
Attribute | Description | Values |
---|---|---|
for | Specifies the relationship between the results of calculation. | Element_id |
form | Specifies output element associated forms | Form_id |
name | Specifies the output name | Text |
Note! <output> tag is not supported by internet explorer.
Example -
<!DOCTYPE html>
<html>
<head>
<title>Option tag example.. </title>
</head>
<body>
<p> Ordered list: </p>
<form>
<input type="range" id="a">
+<input type="number" id="b">
=<output name="x" for="a b"></output>
</form>
</body>
</html>
Output -
Note! The meter element is not supported in Edge 12 or Internet Explorer previous versions.