In this article, we will learn how to define a result of a calculation. The <output> tag is used to representing the result of a calculation performed by the client-side script such as JavaScript. The <output> tag is a new tag in HTML5 and it requires a starting and ending tags.
Syntax:
<output> Results... </output>
Example:
<!DOCTYPE html> <html> <head> <title> Define the result of a calculation </title> <style> body { text-align: center; } h1 { color: green; } </style> </head> <body> <h1>GeeksforGeeks</h1> <h2> HTML5: How to define the result of a calculation? </h2> <form oninput="sumresult.value = parseInt(A.value) + parseInt(B.value) + parseInt(C.value)"> <input type="number" name="A" value="50" /> + <input type="range" name="B" value="0" /> + <input type="number" name="C" value="30" /> <br> Result: <output name="sumresult"></output> </form> </body> </html> |
chevron_right
filter_none
Output:

Supported Browsers:
- Google Chrome
- Internet Explorer
- Firefox
- Opera
- Safari
Recommended Posts:
- How to define marked/highlighted text using HTML5 ?
- How to define important text using HTML5 ?
- How to define a possible line-break using HTML5 ?
- How to define a label for an input element using HTML5 ?
- How to define superscripted text using HTML5 ?
- How to define a title for a document using HTML5 ?
- How to define a form for user input using HTML5 ?
- How to define style information of a document using HTML5 ?
- How to define a part of text in an alternate voice or mood using HTML5 ?
- How to define the number of columns a cell should span using HTML5 ?
- How to define a container for an external (non-HTML) application using HTML5?
- How to define a caption for a fieldset element in HTML5 ?
- How to define keyboard input in HTML5 ?
- How to define a piece of computer code in HTML5?
- How to define subscripted text in HTML5?
- How to define a variable in HTML5 ?
- How to define a paragraph in HTML5 ?
- How to define a drop-down list in HTML5 ?
- How to define an embedded object in HTML5 ?
- How to handle multiple numeric datasets for calculation using JavaScript ?
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to contribute@geeksforgeeks.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.


