output element
<output>
Explanation
Output element is used to find the sum of two numbers.
<form oninput="x.value=parseInt(a.value)+parseInt(b.value)">0
<input type="Value" name="Name" value="Value"/>500
+<input type="Value" name="Name" value="Value" />
=<output name="Value" for="Name"></output>
</form>
Element Specific attributes supported by this element are:
| Attribute | Value | Description |
| for | element_id | Defines the connection between the inputs used in calculation and calculation result. |
| form | form_id | Defines additional forms, in which the <output> is a part of it. |
| name | name | Mentions a name for input. |
Example Code:
Result :
- User cannot edit the result.
- Results are delivered simultaneously when user enters the values in text boxes.
- The minimum value is set as "Zero".
It supports both
Global Attributes and
Event Attributes in HTML5.
It is newly introduced in HTML5 and it is not available in earlier versions of HTML.
Limitations:
Except
Internet Explorer, it will function in all the browsers.