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

HTML DOM Input Search form Property

Input Search form Property

Input Search Object Reference Input Search Object

Example

Return the form containing The form id to which the element belongs:

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

x

The output is:

myForm

Try it »


Definition and Usage

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

On success, this attribute returns the form object.

Note: This attribute is read-only.


Browser support

Internet ExplorerFirefoxOperaGoogle ChromeSafari

All major browsers support the form attribute.


Syntax

searchObject

.form

Technical Details

Return Value: A reference to the form element containing the search field. If the search field is not in a form, null is returned.

Input Search Object Reference Input Search Object