Tutorials References Exercises Videos NEW Menu
Paid Courses Website NEW

HTML <input type="search">

❮ HTML <input> type attribute


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

<label for="gsearch">Search Google:</label>
<input type="search" id="gsearch" name="gsearch">
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.

Tip: Always add the <label> tag for best accessibility practices!

Browser Support

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

type="search" 26.0 10.0 4.0 5.1 12.1


<input type="search">

❮ HTML <input> type attribute