YouTip LogoYouTip

Prop Number Form

HTML DOM Input Number form Property

HTML DOM Input Number form Property

Definition and Usage

The form property returns a reference to the form that contains the number field.

On success, this property returns the form object.

Note: This property is read-only.

Browser Support

The form property is supported in all major browsers.

Note: Internet Explorer 9 and earlier do not support the <input> element with type="number".

Syntax

numberObject.form

Technical Details

Return Value: A reference to the form element that contains the number field. Returns null if the number field is not in a form.

Example

Return the id of the form that the <input type="number"> element belongs to:

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

x output will be:

myForm

Try it yourself Β»

← Prop Number NameProp Number Disabled β†’