HTML | DOM Output form Property
The Output form Property in HTML DOM is used for returning a reference to the form where an <Output> Element belongs to. It is read-only Property that returns a form object on success.
Syntax:
outputObject.form
Note: There is no property values in HTML DOM Output form Property.
Return value: A reference to <form> element containing the <output> element. If <output> element is not in a form, null is returned
Example:
<!DOCTYPE html> <html> <head> <title>HTML DOM output form Property </title> <style> body { text-align: center; } h1 { color: green; } </style> </head> <body> <h1>GeeksforGeeks</h1> <h2>HTML DOM Output Form Property</h2> <form id="form1" 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 id="geeks" name="sumresult" for="A B C"></output> <br> <br> </form> <button onclick="myGeeks()">submit</button> <h2 id="sudo"></h2> <script> function myGeeks() { var g = document.getElementById("geeks").form.id; document.getElementById("sudo").innerHTML = g; } </script> </body> </html> |
- Before Clicking On Button:

- After Clicking On Button:

Supported Browsers: The browsers supported by HTML DOM Output form Property are listed below:
- Google Chrome
- Internet Explorer
- Firefox
- Opera
- Safari
Recommended Posts:
- HTML | <output> form Attribute
- HTML | DOM Form name Property
- HTML | DOM Form noValidate Property
- HTML | DOM Form length Property
- HTML | DOM Select form Property
- HTML | DOM form method Property
- HTML | DOM Form target Property
- HTML | DOM Legend form Property
- HTML | DOM Object form Property
- HTML | DOM Form acceptCharset Property
- HTML | DOM Option form Property
- HTML | DOM Form enctype Property
- HTML | DOM Fieldset form Property
- HTML | DOM Textarea form Property
- HTML | DOM Input URL form Property
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.



