HTML CSS examples for HTML Tag:output
The for attribute links the result of the calculation, and the elements used in the calculation.
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:
<!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>