Input Search form Property

Definition and Usage

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

This property returns the form object on success.

Note:This property is read-only.

Example

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

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

Prova själv

Syntaks

searchObject.form

Tekniska detaljer

Returvärde:

En referens till formulärelement som innehåller sökfältet.

Om sökfältet inte finns i formuläret, returneras null.

Webbläsarstöd

Chrome Edge Firefox Safari Opera
Chrome Edge Firefox Safari Opera
Stöd Stöd Stöd Stöd Stöd