Input Submit form Property

Definition and Usage

form The property returns a reference to the form containing the submit button.

This property returns the form object on success.

Note:This property is read-only.

Example

Return the id of the form containing the <input type="submit"> element:

var x = document.getElementById("mySubmit").form.id;

Try it yourself

Syntax

submitObject.form

Technical details

Return value:

Reference to the form element containing the submit button.

If the submit button is not in the form, then return null.

Browser support

Chrome Edge Firefox Safari Opera
Chrome Edge Firefox Safari Opera
Support Support Support Support Support