šŸš€ LEVEL UP TO SENIOR:Unlock 500+ Advanced Practical Challenges & Exercises.
šŸŽ“ COURSERA PARTNER:Earn professional Google, Meta, and IBM certificates to supercharge your resume.
HTML MASTER CLASS /// LEARN TAGS /// BUILD STRUCTURE /// SEMANTIC WEB /// HTML MASTER CLASS /// LEARN TAGS ///

<search>: A Native Landmark For Search And Filter UI

Master the <search> landmark element: its implicit role="search", correct nesting with a real <form>, appropriate use for both search and filter UIs, and labeling multiple search regions distinctly.

⚔ Total XP: 0|šŸ’» html XP: 0

Skill Matrix

UNLOCK NODES BY LEARNING NEW TAGS.

<search> Element

A native search landmark.


šŸš€ LEVEL UP TO SENIOR:Unlock 500+ Advanced Practical Challenges & Exercises.
šŸŽ“ COURSERA PARTNER:Earn professional Google, Meta, and IBM certificates to supercharge your resume.

role="search" on a generic <div> was always the technically-correct pattern for marking up a search region — but it depended entirely on developers remembering to add it. The <search> element makes that correctness the default.

1An Implicit Landmark, No ARIA Attribute Required

<search> carries an implicit ARIA role of "search" the moment it's used — the same landmark role developers previously had to remember to add manually via role="search" on a <div> or <form>. Screen readers expose a dedicated landmark-navigation mechanism (typically a keyboard shortcut cycling through regions like <header>, <nav>, <main>, <footer>, and now <search>), letting users jump directly to a page's search functionality without linearly tabbing or reading through everything preceding it.

This mirrors exactly how <nav> replaced <div role="navigation"> and <main> replaced <div role="main"> — native HTML semantics that make correct accessibility the path of least resistance instead of an opt-in detail easy to forget.

<search>
  <form role="search" action="/search">
    <input type="search" name="q" aria-label="Search">
  </form>
</search>
localhost:3000
āœ“ Correct By Default, Not By Developer MemoryThe landmark semantics come from the element itself, not from remembering to add role="search".

2A Grouping Landmark, Not A Form Replacement

It's important not to conflate <search> with <form> — they solve different problems and are meant to be used together, not as alternatives. <form> still owns submission behavior: action, method, validation, and the actual HTTP request or client-side handling when submitted. <search> owns landmark semantics: marking the *region* as a search area for assistive technology navigation, regardless of how many controls or forms live inside it.

The correct, common pattern nests a real <form> (or, for a client-side-only instant-filter widget with no traditional submission, a set of related controls without necessarily needing a <form> at all) inside <search> — <search> around, <form> doing the actual submission work within.

<search aria-label="Site search">
  <form action="/search" method="get">
    <input type="search" name="q" aria-label="Search the site">
    <button type="submit">Go</button>
  </form>
</search>
localhost:3000
āœ“ Two Elements, Two Distinct Jobs for the landmark region,
for the actual submission mechanism — used together, not interchangeably.

3What Qualifies, And Labeling Multiple Regions

<search> isn't limited to a single literal <input type="search"> — it applies to any self-contained group of controls whose collective purpose is searching or filtering content: a global header search box, a product-filtering sidebar combining a text input with category and price-range controls, or an in-page 'find in table' widget all qualify equally.

When a page legitimately has more than one <search> region — a global site search plus a page-specific filter panel, for example — each needs its own distinguishing aria-label, exactly the established convention for multiple <nav> landmarks on a single page. Without distinct labels, a screen reader user navigating by landmark hears two unlabeled 'search' regions with no way to tell which is which before entering it.

<search aria-label="Site search">…</search>
<search aria-label="Filter products">…</search>
localhost:3000
āœ“ Broader Than One Input, Requires Labels When RepeatedFilter UIs qualify just as much as a single search box; multiple instances need distinct aria-label values.

4Step-by-Step Breakdown

A Landmark Screen Readers Can Jump Straight To. Screen reader users navigate pages by landmark — jumping directly to <nav>, <main>, or a search region — the way a sighted user's eye jumps to a familiar magnifying-glass icon. Until recently, HTML had no native element for that last one; <search> closes the gap.

<search> Is A Native Landmark With Implicit role="search". The <search> element wraps a search-related group of controls — typically a form containing at least a text input — and carries an implicit ARIA role of "search", giving assistive technology users direct landmark-navigation access to it without any explicit role attribute.

The <search> Element's Implicit Role. What ARIA role does <search> carry implicitly, without needing an explicit role attribute?

  • →role="search"
  • →role="form"
  • →It has no implicit role at all

It's A Grouping Wrapper, Not A Replacement For <form>. <search> doesn't replace or absorb the <form> element — the correct pattern nests a real <form> (or a set of search-related controls) inside <search>, since <search> establishes the landmark region while <form> retains its own distinct submission semantics.

Nesting <search> And <form>. What is the correct relationship between <search> and <form> when building a search UI?

  • →<search> wraps a <form> (or search controls); it doesn't replace <form>
  • →<search> fully replaces the need for a <form> element
  • →<form> should wrap <search>, the reverse order

Direct Landmark Navigation For Screen Reader Users. Screen readers expose a landmark-navigation shortcut (commonly cycling through regions with a dedicated key) letting users jump straight between <header>, <nav>, <main>, and now <search> — without <search>, users had to either tab through the entire page or rely on the site author correctly adding role="search" manually, which was frequently forgotten.

The Real Accessibility Payoff. Before <search> existed, how did most sites (correctly) mark up a search region for landmark navigation?

  • →Manually adding role="search" to a <div> or <form> — easy to forget
  • →There was no way to achieve this at all before <search>
  • →A dedicated aria-search="true" attribute

Appropriate Uses: Site Search, Filter UIs, And In-Page Search Widgets. <search> suits any self-contained group of controls whose purpose is searching or filtering content — a global site-search widget in the header, a product-filtering sidebar on an e-commerce listing page, or an in-page 'find in table' control — not just a single literal <input type="search">.

When <search> Applies. Does a product-filtering sidebar (search box plus category/price filters) on an e-commerce page qualify for <search>?

  • →Yes — it's a self-contained group of controls for searching/filtering content
  • →No — <search> only applies to a single, literal <input type="search">
  • →No — <search> can only be used in the page header

Give Multiple <search> Regions Distinct Accessible Names. If a page has more than one <search> region — a global header search and a page-specific in-content filter, for instance — each needs a distinct aria-label so landmark navigation announces which is which, exactly the same requirement that already applies to multiple <nav> elements on one page.

Multiple <search> Regions. A page has both a global header search and a separate in-page result-filtering widget. What should each <search> element have?

  • →A distinct aria-label on each, so landmark navigation can announce which is which
  • →Nothing extra — <search> elements are automatically distinguished
  • →A page can only legally contain one <search> element

<search> Element Mastered. You now know how to mark up search and filter UIs with the <search> landmark element, why it wraps rather than replaces <form>, and how to label multiple search regions on the same page distinctly for landmark navigation.

Wrap A Search Form Semantically. The <search> landmark element wraps a form whose purpose is searching the page or site.

Level Up šŸš€

Advanced cheat sheets, SEO tricks, and interview prep for this topic.

Browser Support

ChromeSupported

Fully supported.

FirefoxSupported

Fully supported.

SafariSupported

Fully supported.

EdgeSupported

Fully supported.

Accessibility (A11y)

1<search> Gives Landmark-Navigation Users Direct Access, Replacing A Manual, Frequently-Forgotten role Attribute

This is the entire value proposition of the element — correctness that doesn't depend on a developer remembering an ARIA attribute.

2Every <search> Region Still Needs Its Own Accessible Name If More Than One Exists On A Page

Follow the same aria-label discipline already required for multiple <nav> landmarks.

SEO Implications

  • 1

    Native Semantic Landmarks Help Automated Content Understanding, Including By AI Crawlers

    Beyond assistive technology, structured, semantically-correct regions make a page's structure easier for any automated system — search engines or LLM-based crawlers — to correctly interpret, distinguishing genuine content from UI chrome like search controls.

Best Practices

Use <search> For Any Self-Contained Search Or Filter Control Group, Not Only A Single Input

Filter sidebars and multi-control search widgets benefit from the same landmark navigation as a simple search box.

Always Nest A Real <form> (Or Equivalent Controls) Inside <search>, Never Treat It As A Form Substitute

<search> provides landmark semantics only — actual submission behavior still requires <form> doing its own distinct job.

Frequent Bugs

THE BUG

A page still uses <div role="search"> out of habit, missing the opportunity to use the native, less error-prone <search> element.

THE FIX

Replace <div role="search"> with <search> — the implicit role means the manual attribute is no longer needed.

THE BUG

Two <search> regions on one page (header search + sidebar filter) with no distinguishing labels, both announced identically by landmark navigation.

THE FIX

Add a distinct aria-label to each <search> element, describing its specific purpose.

Real-World Examples

A Header Search Plus A Filter Sidebar, Both Labeled

An e-commerce page with two distinct <search> landmarks that need to be individually identifiable via landmark navigation.

<header>
  <search aria-label="Site search">
    <form action="/search"><input type="search" name="q" aria-label="Search"></form>
  </search>
</header>
<aside>
  <search aria-label="Filter products">
    <form>
      <input type="search" name="q" aria-label="Filter by name">
      <select name="category"><option>All</option></select>
    </form>
  </search>
</aside>

Interview Prep

?Frequently Asked Questions

Pascual Vila

Pascual Vila

Frontend Instructor // Code Syllabus

Common Pitfalls & Errors

The Error //

Continuing to use <div role="search"> instead of the native <search> element

<!-- Old --> <div role="search">…</div> <!-- Current --> <search>…</search>

The Solution //

Replace it with <search>, which conveys the same role implicitly without a manual ARIA attribute.

The Error //

Treating <search> as a replacement for <form>, omitting the actual <form> element

<search> <form action="/search"><input type="search" name="q"></form> </search>

The Solution //

Keep a real <form> nested inside <search> for the actual submission mechanism — <search> only provides landmark semantics.

Lesson Glossary

[01]<search>

A landmark element wrapping search/filter UI, with implicit role="search".

Code Preview
<search><form>…</form></search>

[02]Landmark Navigation

A screen reader mechanism for jumping directly between page regions.

Code Preview
header, nav, main, search, footer

[03]Implicit ARIA Role

A role automatically conveyed by a native element, no attribute needed.

Code Preview
<search> = role="search" implicitly

[04]Accessible Name

The label assistive technology announces for an element/region.

Code Preview
aria-label="Filter products"

Continue Learning