Input Search form Property

Definition and Usage

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

This property returns the form object on success.

Note:This property is read-only.

Example

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

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

Try It Yourself

Syntax

searchObject.form

Technical Details

Return Value:

Reference to the form element that contains the search field.

If the search field is not in the form, then return null.

Browser Support

Chrome Edge Firefox Safari Opera
Chrome Edge Firefox Safari Opera
Support Support Support Support Support