` element: ``` var x = document.getElementById("mySearch").form.id; ``` ``` myForm ``` ---"> ` element: ``` var x = document.getElementById("mySearch").form.id; ``` ``` myForm ``` ---" />
Easy Tutorial
❮ Prop Input Time Disabled Prop Element Offsetheight ❯

Input Search form Attribute

Input Search Object

Example

Returns the form ID of the <input type="search"> element:

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

Definition and Usage

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

This attribute returns a form object upon success.

Note: This attribute is read-only.


Browser Support

All major browsers support the form attribute.


Syntax

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. | | --- | --- |

❮ Prop Input Time Disabled Prop Element Offsetheight ❯