You are here: Reference > JavaScript > client-side > HTML DOM > properties > form (input, select, textarea, ...)
form property (input, select, textarea, ...)
Returns a reference to the form element in which the object is placed.
Syntax:
You can find the related objects in the Supported by objects section below.
This property is read-only.
Possible values:
Default: this property has no default value.
Example HTML code 1:
This example illustrates the use of the form property:
|
||||
<head> <script type="text/javascript"> function GetForm (button) { alert ("The id of the container form: " + button.form.id); } </script> </head> <body> <form id="myForm"> <div> <input type="button" value="Get the ID of the container form!" onclick="GetForm (this);"/> </div> </form> </body> |
||||
|
||||
Did you find this example helpful?
|
Supported by objects:
HTML elements:
Related pages:
External links:
User Contributed Comments