Input Search type Attribute

Definition and Usage

type The property returns what type of form element the search field is.

For the search field, this property will always return "search".

Example

Returns the type of form element to which the search field belongs:

var x = document.getElementById("mySearch").type;

Try It Yourself

Syntax

searchObject.type

Technical Details

Return Value: A string value that indicates the type of form element that the search field is located in.

Browser Support

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