Input Number formProperty

Input Number 对象参考手册Input Number Object

Examples

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

var x = document.getElementById("myNumber").form.id;
xThe output result is:
myForm

Try it »

Definition and Usage

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

On success, this property returns the form object.

Note:This property is read-only.


Browser Support

Internet ExplorerFirefoxOperaGoogle ChromeSafari

All mainstream browsers support the form property.

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


Syntax

numberObject.form

Technical Details

Return value: A reference to the form element containing the number field. Returns null if the number field is not in a form.


Input Number 对象参考手册Input Number Object Other Extensions