HTML DOM Input Search form Property
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
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
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. |
|---|
YouTip