HTML Anchors and Hyperlinks Open link in new tab/window


<a href="" target="_blank">Text Here</a>

The target attribute specifies where to open the link. By setting it to _blank, you tell the browser to open it in a new tab or window (per user preference).


Using target="_blank" gives the opening site partial access to the window.opener object via JavaScript, which allows that page to then access and change the window.opener.location of your page and potentially redirect users to malware or phishing sites.

Whenever using this for pages you do not control, add rel="noopener" to your link to prevent the window.opener object from being sent with the request.

Currently, Firefox does not support noopener, so you will need to use rel="noopener noreferrer" for maximum effect.