Home Tutorials HTML Tutorial Output Element
Output Element

Output Element


34. Output Element

The <output> element represents the result of a calculation or user action in a form. It is part of newer HTML5 form-related elements.

Syntax

<output>Result</output>

Example

<form oninput="x.value=parseInt(a.value)+parseInt(b.value)">
    <input type="number" id="a" value="5"> +
    <input type="number" id="b" value="10"> =
    <output name="x"></output>
</form>

Output

Two number fields appear, and the output area displays their sum when values change.
Example

🏋️ Test Yourself With Exercises

Take our quiz on Output Element to test your knowledge.

Browse Quizzes »