HTML4 HTML5
Used to represent calculation results, processed data, or script execution output (e.g., JavaScript) in the context of a web form[cite: 3].
Both opening and closing tags are mandatory[cite: 3].
Attributes:
for – links the result to form elements (by their id attributes) involved in calculations (space-separated IDs)[cite: 3].form – specifies the identifier (id) of the form this output element belongs to[cite: 3].name – element name submitted together with the form[cite: 3].class, id, and style are also used[cite: 3].Code:
The browser will interpret this code as follows:
HTML4 HTML5