search – search

<search>…</search>

A wrapper for searching and filtering: the search form of a website, filters in a product listing or search results. It replaces the former <form role="search"> – the form stays inside, search only marks the landmark.

  • Default display: display: block
  • End tag: required
  • Content: flow content (usually a form)
  • Where it can be used: anywhere flow content is allowed
  • DOM interface: HTMLElement

Attributes

Only global attributes.

Examples

Searching the website:

<search>
  <form action="/search/">
    <label for="search-term">Search the website</label>
    <input type="search" id="search-term" name="q">
    <button type="submit">Search</button>
  </form>
</search>

Accessibility

search has the search role – screen readers can jump straight to the search. Browsers that do not support the element turn it into an ordinary inline element without a role. For them people used to write <search role="search"> – in current browsers the extra role is unnecessary.

Things to watch out for

  • It is only a wrapper – the searching itself is done by the form inside.
  • The element is new: Chrome and Firefox have known it since version 118, Safari since 17 (end of 2023). Older browsers treat it as an unknown inline element – if the layout matters, add search { display: block; }.

Browser support

Baseline – widely available: in all major browsers since October 2023, considered widely available since April 2026. Since version: Chrome 118, Firefox 118, Safari 17. As of October 2026 (MDN browser-compat-data).

Related:
form – form
input – input field
nav – navigation
role – element role (attribute)