output for Attribute - HTML CSS HTML Tag

HTML CSS examples for HTML Tag:output

Description

The for attribute links the result of the calculation, and the elements used in the calculation.

Attribute Values

Value Description
element_id sets a space separated list of ids of one or more elements to link result of the calculation, and the elements used in the calculation

The following code shows how to Perform a calculation and show the result in an <output> element:

Demo Code

ResultView the demo in separate window

<!DOCTYPE html>
<html>
<body>

<form oninput="x.value=parseInt(a.value)+parseInt(b.value)">0
<input type="range" id="a" value="50">100
+<input type="number" id="b" value="50">
=<output name="x" for="a b"></output>
</form><!--   ww  w  .  j  a  va  2s .c o m-->

</body>
</html>

Related Tutorials