Input Number form Attribute

Definition and Usage

form The property returns a reference to the form containing the numeric field.

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="number"> element:

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

Try It Yourself

Syntax

numberObject.form

Technical Details

Return Value:

Reference to a form element containing a numeric field.

If the number field is not in the form, it returns null.

Browser Support

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