Open external links in a new tab the right way

What target="_blank" needs next to it, and whether it needs anything anymore.

SNP 107 #149 Filed html webdev

html
<a href="https://example.com" target="_blank" rel="noopener noreferrer">Example</a>

noopener stops the new page from reaching back to yours through window.opener, which used to be a phishing trick. Every current browser now implies it for _blank, so it's belt and braces. noreferrer also hides where the visitor came from; drop it if you want sites to see the referral.

Tell people the link opens elsewhere, screen reader users in particular:

html
<a href="https://example.com" target="_blank" rel="noopener">
  Example <span class="sr-only">(opens in a new tab)</span>
</a>

Or just don't force a new tab. People know how to middle-click.