Link safety checklist
When your page links to an external site with target="_blank", always add rel="noopener noreferrer" to prevent the new page from hijacking your window and stealing referrer data.
| What you want | Attribute | Effect |
|---|---|---|
| Open in new tab | target="_blank" |
Browser opens a new tab |
| Prevent window hijack | rel="noopener" |
New tab runs in a separate browsing context — no access to window.opener |
| Hide referrer header | rel="noreferrer" |
Target site cannot see your page URL in its access logs |
| Best practice | rel="noopener noreferrer" |
Combines both protections — always use this pair together |
Live demo
Safe — rel noopener noreferrer Unsafe — missing relBoth buttons would normally open example.com in a new tab. The safe version is what you should ship.
Download attribute
Use the download attribute when you want the browser to save a file instead of previewing it inline. You can also suggest a filename: