HTML <input> type="search"

The <input> tag with a type="search" attribute creates a search text field. Search fields are similar to text fields but are designed for search queries.

Example

#

An <input> element of type search.
Clicking submit prepopulates the search box in the Google search page.

Search with Google

<form target="_blank" action="https://www.google.com">
  <fieldset>
    <legend>Search with Google</legend>

    <input type="search" name="q" value="rubber duckies"><br /><br />

    <input type="submit" value="Submit">
  </fieldset>
</form>

Using input type="search"

The <input type="search"> creates a search input field.

Search fields are used to enter a query. Other than that, they function the same as text fields.

Depending on the browser, search fields may look a bit different from text fields.


Syntax

<input type="search">

Browser support

Here is when type="search" support started for each browser:

Chrome
26.0 Mar 2013
Firefox
4.0 Mar 2011
IE/Edge
10.0 Sep 2012
Opera
12.1 Nov 2012
Safari
5.1 Oct 2011

You may also like

 Back to <input>
Guides