The Submit form property
The Submit objectDefinitions and usages
The form property returns a reference to the form that contains the confirmation button.
If successful, the property returns a form object.
Grammar
Browser support
The form property is supported by all major browsers
The following example returns the id of the form to which the confirmation button belongs:
<html>
<head>
<meta charset="utf-8">
Online tutorials for W3Cschool (w3cschool.cn)
<script>
function displayResult(){
var x=document.getElementById("submit1").form.id;
alert(x);
}
</script>
</head>
<body>
<form id="form1">
Email: <input type="text" id="email">
<input type="submit" id="submit1">
</form>
"button" onclick" "displayResult()"
</body>
</html>
Try it out . . .
The Submit object