files/en-us/web/api/htmlanchorelement/referrerpolicy/index.md
{{APIRef("HTML DOM")}}
The
HTMLAnchorElement.referrerPolicy
property reflect the HTML referrerpolicy attribute of the
{{HTMLElement("a")}} element defining which referrer is sent when fetching the resource.
A string; one of the following:
no-referrer
no-referrer-when-downgrade
origin
https://example.com/page.html will send the referrer
https://example.com/.origin-when-cross-origin
same-origin
strict-origin
strict-origin-when-cross-origin (default)
unsafe-url
const elt = document.createElement("a");
const linkText = document.createTextNode("My link");
elt.appendChild(linkText);
elt.href = "https://developer.mozilla.org/en-US/";
elt.referrerPolicy = "no-referrer";
const div = document.getElementById("divAround");
div.appendChild(elt); // When clicked, the link will not send a referrer header.
{{Specifications}}
{{Compat}}