<search>...</search>

HTML4 HTML5

The <search> tag is a relatively new semantic container in the HTML5 specification[cite: 3]. It surrounds elements forming a search or filtering section – such as forms with a text field and submit button, filters, or site search options[cite: 3].

It provides improved accessibility, informing screen readers and web crawlers that this section is used for searching information[cite: 3].

Both opening and closing tags are mandatory[cite: 3].

Attributes:

Example

In the example below, the <search> container groups a form with an input field and search button[cite: 3]:

Code:

<search> <form action="/search" method="get"> <label for="site-search">Search site:</label> <input type="search" id="site-search" name="q" placeholder="Enter query..."> <button type="submit">Search</button> </form> </search>

The browser will interpret this code as follows: