THE WORLD'S LARGEST WEB DEVELOPER SITE

HTML <input type="search">

❮ HTML <input> type attribute

Example

Define a search field (like a site search, or Google search):

Search Google: <input type="search" q="googlesearch">
Try it Yourself »

Definition and Usage

The <input type="search"> defines a text field for entering a search string.

Note: Remember to set a name for the search field, otherwise nothing will be submitted. The most common name for search inputs is q.


Browser Support

The numbers in the table specify the first browser version that fully supports the element.

Attribute
type="search" 26.0 10.0 4.0 5.1 12.1

Syntax

<input type="search">

❮ HTML <input> type attribute