Denoting the Result of a Calculation

Description

The output element represents the result of a calculation.

It has local attributes:name, form, for.

Example

The following code shows the output element in use.


<!DOCTYPE HTML>
<html>
<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" />
      =<!--from   w w w  .j a  v  a 2  s . co  m-->
      <output for="quant name" name="res" />
    </fieldset>
  </form>
</body>
</html>

Click to view the demo





















Home »
  HTML CSS »
    HTML »




HTML Introduction
HTML Document
HTML Section
HTML Group Content
HTML Text Marker
HTML Table
HTML Form
HTML Embed