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:
class, id, and style are used[cite: 3].In the example below, the <search> container groups a form with an input field and search button[cite: 3]:
Code:
The browser will interpret this code as follows: