html tutorial - Output tag in HTML - html5 - html code - html form
- The <output> tag shows the result of a calculation.
- The <output> tag belongs to flow content, phrasing content, form-associated element, listed, labelable, resettable and palpable content.
- The <output> tag supports Global Attributes and Event Attributes.
Syntax for output tag:
Differences between HTML 4.01 and HTML5 for <output> tag:
- HTML4 does not supports <output> tag.
- The <output> tag is new in HTML5.
Sample Coding for <output> tag:
Code Explanation for <output> tag:
- oninput event triggers when user gives any input if the event triggered the concatenated string of and b will be stored in c.
- The <input> tag textbox named as a and its value will be “Wiki”.
- The <input> tag textbox named as b and its value will be “techy”.
- The <output> tag named as c and that will be show the concatenated output of a and b.
Output of <output> tag:
- The output shows the two textboxes with values as “Wiki” and “Techy”.
- When the user change the text in the text box that will be manipulated and displayed in the output.
|Attribute||HTML 4.0.1||HTML 5||Description|
|form||no||Yes||The <output> tag belongs to specify one or more forms.|
|name||no||Yes||Defines a name for the <output>tag.|
|for||no||Yes||Indicates the relation between the result of the calculation, and the elements used in the calculation.|
Browser Support for <output> tag: