The HTML Native Search Element
The HTML specification introduced the search element in 2023 as a dedicated container for search interfaces.
The <search>
element acts as a semantic wrapper for search forms and filtering UI components. It provides better accessibility than generic <div>
elements and clarifies the purpose of search-related content to both browsers and assistive technologies.
Before its introduction, developers relied on generic div elements with ARIA roles to indicate search regions — a workable but less than ideal solution. The search element changes this by providing native semantic meaning for search and filtering interfaces.
<search> <!-- NEW -->
<form>
<input type="search" placeholder="Search...">
<button type="submit">Search</button>
</form>
</search>
The type="search"
input provides platform-specific features like clear buttons on some browsers.