The output element is intended to be used to represent a result of a calculation or a user action.

This element may be easily used in combination with JavaScript and oninput event, and applied to multiple input tags.

Syntax:

<input type="" id="input" />

<output name="output" for="input"></output>

Attributes:

  • for - Used as a pointer that specifies which element (or elements) the <output> element is linked to; the value must be that element's id attribute or, if more than one, ids separated by empty space.
  • name - Specifies the name of the <output> element.
  • form - Specifies form or forms that the <output> element belongs too; the value is form_id.
  • global attributes
  • event attributes

Example

The example of using output element:

 

›› go to examples ››