• Skip to main content
  • Skip to search
  • Skip to select language
MDN Web Docs
  • References
    • Overview / Web Technology

      Web technology reference for developers

    • HTML

      Structure of content on the web

    • CSS

      Code used to describe document style

    • JavaScript

      General-purpose scripting language

    • HTTP

      Protocol for transmitting web resources

    • Web APIs

      Interfaces for building web applications

    • Web Extensions

      Developing extensions for web browsers

    • Accessibility

      Build web projects usable for all

    • Web Technology

      Web technology reference for developers

  • Learn
    • Overview / MDN Learning Area

      Learn web development

    • MDN Learning Area

      Learn web development

    • HTML

      Learn to structure web content with HTML

    • CSS

      Learn to style content using CSS

    • JavaScript

      Learn to run scripts in the browser

    • Accessibility

      Learn to make the web accessible to all

  • Plus
    • Overview

      A customized MDN experience

    • AI Help

      Get real-time assistance and support

    • Updates

      All browser compatibility updates at a glance

    • Documentation

      Learn how to use MDN Plus

    • FAQ

      Frequently asked questions about MDN Plus

  • Curriculum New
  • Blog
    • Playground

      Write, test and share your code

    • HTTP Observatory

      Scan a website for free

    • AI Help

      Get real-time assistance and support

  • Log in
  • Sign up for free
  1. 面向开发者的 Web 技术
  2. HTML(超文本标记语言)
  3. HTML 参考
  4. HTML 元素参考
    • English (US)
    • Deutsch
    • 日本語
    • 正體中文 (繁體)

此页面由社区从英文翻译而来。了解更多并加入 MDN Web Docs 社区。

在本文中

  • 属性
  • 使用说明
  • 无障碍考虑
  • 示例
  • 技术概要
  • 规范
  • 浏览器兼容性
  • 参见
  1. HTML(超文本标记语言)
  2. 指南
  3. 内容分类
  4. 注释
  5. HTML 中使用的日期与时间格式
  6. 约束验证
  7. viewport meta 标记
  8. 响应式图片
  9. 微数据
  10. 微格式
  11. 怪异模式和标准模式
  12. HTML cheatsheet
  13. How to
  14. Define terms with HTML
  15. 使用数据属性
  16. 允许图片和 canvas 跨源使用
  17. 在图像上层添加点击映射
  18. 编写快速加载的 HTML 页面
  19. Add JavaScript
  20. 参考
  21. HTML 元素
    1. 已弃用
    2. 已弃用

    3. 已弃用
    4. 已弃用
    5. 实验性
    6. 已弃用
    7. 已弃用
    8. 已弃用

Web 应用搜索

此示例演示了在 web 应用程序中动态加入 JavaScript 搜索功能时可能出现的 DOM 内容。在完全使用 JavaScript 实现搜索功能时,如果没有提交表单,则既不需要 元素,也不需要提交

多重搜索

此示例演示了一个具有两种搜索特性的页面。首先是位于页眉的全局网站搜索。第二种是基于页面上下文的搜索和筛选,在我们的例子中是汽车搜索。

HTML

html

  

汽车租赁公司

...

可供出租的汽车

筛选结果

...

结果

技术概要

内容分类 流式内容、短语内容。
允许的内容 流式内容。
标签省略 不允许,开始标签和结束标签都不能省略。
隐含的 ARIA 角色 search
允许的 ARIA 角色 form、group、none、presentation、region、search
DOM 接口 HTMLElement

规范

Specification
HTML
# the-search-element

浏览器兼容性

参见

  • 其他搜索相关元素:
    、
    、
    、
    、
  • ARIA:Search 角色

Help improve MDN

Learn how to contribute.

This page was last modified on 2025年4月13日 by MDN contributors.

View this page on GitHub • Report a problem with this content
MDN logo

Your blueprint for a better internet.

  • MDN on Bluesky
  • MDN on Mastodon
  • MDN on X (formerly Twitter)
  • MDN on GitHub
  • MDN Blog RSS Feed

MDN

  • About
  • Blog
  • Careers
  • Advertise with us

Support

  • Product help
  • Report an issue

Our communities

  • MDN Community
  • MDN Forum
  • MDN Chat

Developers

  • Web Technologies
  • Learn Web Development
  • MDN Plus
  • Hacks Blog
  • Website Privacy Notice
  • Cookies
  • Legal
  • Community Participation Guidelines

Visit Mozilla Corporation’s not-for-profit parent, the Mozilla Foundation.
Portions of this content are ©1998–2025 by individual mozilla.org contributors. Content available under a Creative Commons license.