HTML <form> rel Attribute

The rel attribute on a <form> element defines the relationship between the current page and the form-handler. Multiple relationships can be defined by space-separating the values.

Example

#

A <form> tag with a rel attribute.
The form data is submitted to an external url without referrer information.



<form action="https://google.com" rel="external noreferrer" target="_blank">
  <input type="text" name="q" placeholder="Search criteria..."><br/><br/>

  <button type="submit">Submit</button>
</form>

Using rel

The rel attribute defines the relationship between the current page and the action URL.

Multiple relationships can be defined by space-separating the values.


Syntax

<tagname rel="nofollow | noopener | noreferrer | external | author | 
              help | license | prev | next | bookmark | search" />

Values

#

Value Description
nofollow Specifies the link is not endorsed or is not controlled by the current page's author. Search engines often ignore links flagged as nofollow.
noopener No context or information about the current page is sent to the linked page. Used for untrusted links to avoid tampering with the current page.
noreferrer Prevents the browser from sending referrer data about the current page.
external Indicates the link is to a page outside the current site (different domain). Applies to: a, area, form
help Specifies the link is to a help page.
license Specifies the link is to a page with licensing information.
prev Specifies the previous page in a series of pages.
next Specifies the next page in a series of pages.
search Specifies the link is to a search page for the current page.

Browser support

Here is when rel support started for each browser:

Chrome
1.0 Sep 2008
Firefox
1.0 Sep 2002
IE/Edge
1.0 Aug 1995
Opera
1.0 Jan 2006
Safari
1.0 Jan 2003

You may also like

 Back to <form>
Guides