YouTip LogoYouTip

Prop Search Form

HTML DOM Input Search form Property

HTML DOM Input Search form Property

Input Search Object Reference Input Search Object

Example

Return the id of the form that contains the <input type="search"> element:

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

x output will be:

myForm

Try it yourself Β»


Definition and Usage

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

On success, this property returns a form object.

Note: This property is read-only.


Browser Support

Internet Explorer Firefox Opera Google Chrome Safari

The form property is supported in all major browsers.


Syntax

searchObject.form

Technical Details

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

Input Search Object Reference Input Search Object

← Prop Search DisabledProp Search Disabled β†’