![]() |
Definition and UsageThe tag is used to represent the result of a calculation (like one performed by a script). Browser SupportThe numbers in the table specify the first browser version that fully supports the element. Attributes
Global AttributesThe tag also supports the Global Attributes in HTML. Event AttributesThe tag also supports the Event Attributes in HTML. |
Perform a calculation and show the result in an <output> element.
Example:
HTML
<form oninput="x.value=parseInt(a.value)+parseInt(b.value)">
<input type="range" id="a" value="50">
+<input type="number" id="b" value="25">
=<output name="x" for="a b"></output>
</form>
Most browsers will display the <output>
element with the following default values.
Example:
HTML
<!DOCTYPE html>
<html>
<style>
output {
display: inline;
}
</style>
<body>
<h1>The output element</h1>
<form oninput="x.value=parseInt(a.value)+parseInt(b.value)">
<input type="range" id="a" value="50">
+<input type="number" id="b" value="25">
=<output name="x" for="a b"></output>
</form>
<p><strong>Note:</strong> The output element is not supported in Edge 12 (or earlier).</p>
</body>
</html>
The for
attribute specifies the relationship between the result of the calculation, and the elements used in the calculation.
The numbers in the table specify the first browser version that fully supports the attribute.
<output for="element_id">
Value | Description |
---|---|
element_id | Specifies a space separated list of ids of one or more elements that specifies the relationship between the result of the calculation, and the elements used in the calculation |
It performs a calculation and show the result in an <output> element.
Example:
HTML
<form oninput="x.value=parseInt(a.value)+parseInt(b.value)">
<input type="range" id="a" value="50">
+<input type="number" id="b" value="25">
=<output name="x" for="a b"></output>
</form>
The form
attribute specifies the form the <output>
tag belongs to.
The value of the form
attribute must be equal to the id
attribute of a <form>
element in the same document.
<output form="form_id">
Value | Description |
---|---|
form_id | Specifies the form element the <output> element belongs to. The value of this attribute must be the id attribute of a <form> element in the same document. |
It is An <output> element which is located outside a form (but still a part of the form).
Example:
HTML
<form action="/action_page.php" id="numform" oninput="x.value=parseInt(a.value)+parseInt(b.value)">
<input type="range" id="a" name="a" value="50">
+ <input type="number" id="b" name="b" value="25">
<br><br>
<input type="submit">
</form>
The name
attribute specifies the name of an <output>
element.
The name
attribute is used to reference form data after it has been submitted, or to reference the element in a JavaScript.
The numbers in the table specify the first browser version that fully supports the attribute.
<output name="name">
Value | Description |
---|---|
name | Specifies the name of the <output> element |
It performs a calculation and show the result in an <output> element.
Example:
HTML
<form oninput="x.value=parseInt(a.value)+parseInt(b.value)">
<input type="range" id="a" value="50">
+<input type="number" id="b" value="25">
=<output name="x" for="a b"></output>
</form>
How to add HTML <output> Tag | HTML Tag |
How to set Default CSS Settings on HTML <output> Tag | HTML Tag |
What is HTML <output> for Attribute | HTML Tag |
How to add HTML <output> for Attribute | HTML Tag |
What is HTML <output> form Attribute | HTML Tag |
How to add HTML <output> form Attribute | HTML Tag |
What is HTML <output> name Attribute | HTML Tag |
How to create HTML <output> name Attribute | HTML Tag |
Read Full: | HTML Tag |
Type: | Develop |
Category: | Web Tutorial |
Sub Category: | HTML Tag |
Uploaded by: | Admin |
Views: | 442 |
Reffered: https://www.w3schools.com/tags/tag_output.asp