Link Relationships

HTML rel="search"

Build a form with the HTML form generator

Identifies a search resource for the current site or document. OpenSearch discovery requires a suitable description file and browser support; an ordinary search form is separate. The example belongs in a document head; resource URLs are illustrative. Supply actual resources and server configuration to observe network behavior.

Formal Syntax & Structure

html syntaxhtml
<link rel="search" type="application/opensearchdescription+xml" href="/search.xml" title="Site search">

Parameters & Attributes

NameTypeDescription
relspace-separated relationship tokensInclude search on an element that supports this relationship.
hrefURL or fragmentIdentifies the linked destination or resource.

Working Example

Example Snippethtml
<!doctype html><html lang="en">  <head>    <meta charset="utf-8">    <title>Example</title>    <link rel="search" type="application/opensearchdescription+xml" href="/search.xml" title="Site search">  </head>  <body>    <p>Example document</p>  </body></html>
HTML Reference