Skip to content
Related Articles
Open in App
Not now

Related Articles

How to define the result of a calculation using HTML5 ?

Improve Article
Save Article
  • Last Updated : 28 May, 2020
Improve Article
Save Article

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.


<output> Results... </output>


<!DOCTYPE html>
        Define the result 
        of a calculation
        body {
            text-align: center;
        h1 {
            color: green;
        HTML5: How to define the 
        result of a calculation?
    <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" />
        Result: <output name="sumresult"></output>


Supported Browsers:

  • Google Chrome
  • Internet Explorer
  • Firefox
  • Opera
  • Safari

My Personal Notes arrow_drop_up
Related Articles

Start Your Coding Journey Now!