HTML Tutorial - HTML Form output

The output element represents the result of a calculation.

It has local attributes:name, form, for.

The following code shows the output element in use.

  <form onsubmit="return false"
    oninput="res.value = quant.valueAsNumber *  price.valueAsNumber">
      <legend>Price Calculator</legend>
      <input type="number" placeholder="Quantity" id="quant" name="quant" />
      x <input type="number" placeholder="Price" id="price" name="price" />
      =<!--  w w  w.  ja  v a2  s . c  om-->
      <output for="quant name" name="res" />

Click to view the demo