HTML DOM form Property
Complete Submit Object Reference
Definition and Usage
The form property returns a reference to the form that contains the submit button.
This property returns a form object on success.
Syntax
Example
The following example returns the id of the form containing the submit button:
<html>
<body>
<form id="form1">
<input type="submit" id="submit1" />
</form>
<p>The id of the form containing the submit button is:
<script type="text/javascript">
x=document.getElementById('submit1');
document.write(x.form.id);
</script></p>
</body>
</html>
|
Try-It-Yourself Demos
Return
the id of the form containing the submit button
Complete Submit Object Reference
|