HTML | <output> for Attribute
The HTML <output> for Attribute is used to specify the the relationship between the result and the calculation.
Syntax:
<output for="element_id">
Attribute Values: It contains a value i.e element_id which specify the separated list of ids of one or more elements that specify the relationship between the result and the calculation.
Example: This Example that illustrates the use of for attribute in Output Element.
<!DOCTYPE html> <html> <head> <title> HTML | For Attribute </title> <style> body { text-align: center; } h1 { color: green; } </style> </head> <body> <h1>GeeksforGeeks</h1> <h2> HTML | <output>For Attribute </h2> <form oninput="sumresult.value = parseInt(A.value) + parseInt(B.value) + parseInt(C.value)"> <input type="number" name="A" value="50" /> + <input type="range" name="B" value="0" /> + <input type="number" name="C" value="50" /> <br /> Submit Result: <output name="sumresult" for="A B C"> </output> <br> <input type="submit"> </form> </body> </html> |
Output:

Supported Browsers: The browser supported by HTML | <label>for Attribute are listed below:
- Google Chrome
- Internet Explorer
- Firefox
- Opera
- Safari
Recommended Posts:
- HTML | <img> src Attribute
- HTML | low Attribute
- HTML | for Attribute
- HTML | <map> name Attribute
- HTML | <li> value Attribute
- HTML | min Attribute
- HTML | value Attribute
- HTML | <a> rel Attribute
- HTML | <img> alt Attribute
- HTML | dir Attribute
- HTML | hreflang Attribute
- HTML | formaction Attribute
- HTML | <td> align Attribute
- HTML | <input> alt Attribute
- HTML | autocomplete Attribute
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to contribute@geeksforgeeks.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.



