HTML: input type="search"

The search input is a text field intended for search queries and may provide a clear button or search-friendly behavior in the browser.

What you will learn

Minimal example

<form action="/search" method="get">
  <label for="site-search">Search this site</label>
  <input id="site-search" name="q" type="search">
  <button type="submit">Search</button>
</form>

The input type communicates the purpose to browsers and assistive technology. The actual search behavior still comes from your form action or JavaScript.

Common mistakes