Input Search formProperty

Input Search 对象参考手册Input Search Object

Example

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

var x = document.getElementById("mySearch").form.id;
xThe output result is:
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 the form object.

Note:This property is read-only.


Browser Support

Internet ExplorerFirefoxOperaGoogle ChromeSafari

All major browsers support the form property.


Syntax

searchObject.form

Technical Details

Return Value: A reference to the form element that contains the search field. If the search field is not in a form, returns null.


Input Search 对象参考手册Input Search Object Other Extensions