<output>Denoting the Result of a Calculation

The output element represents the result of a calculation.

 
<!DOCTYPE HTML>
<html>
<head>
<title>Example</title>
</head>
<body>
      <form onsubmit="return false"
            oninput="res.value = quant.valueAsNumber * price.valueAsNumber">
            <fieldset>
                  <legend>Price Calculator</legend>
                  <input type="number" placeholder="Quantity" id="quant" name="quant" />
                  x <input type="number" placeholder="Price" id="price" name="price" />
                  =
                  <output for="quant name" name="res" />
            </fieldset>
      </form>
</body>
</html>
  
Click to view this demo.
Home 
  HTML CSS Book 
    HTML  

Related: