Private archive copy · Unofficial site · Content copyright belongs to Runoob Tutorial and the original authors · View Original

HTML DOM Input Text form property

Input Text form property

Input Text Object Reference The Input Text object

Example

Return the form containing the element's form id:

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

x The output is:

myForm

Try it »


Definition and Usage

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

On success, this property returns the form object.

Note: This attribute is read-only.


Browser support

Internet Explorer Firefox Opera Google Chrome Safari

All major browsers support the form attribute


Syntax

textObject

.form

Technical details

Return value: A reference to the form element that contains the text field. Returns null if the text field is not inside a form.

Input Text Object Reference The Input Text object