a-if

  • Blog

Open Link in New Tab

Written by

Hotaru

at

2024-08-26 17:15:25 (GMT+0700)

Today I’m creating some pages that have many links that I want to redirect to external sources but I want it to open in a new tab. Just remembering that it can become a vector of attacks there.

TL;DR, just do it like this:

<p>Check out <a href="https://www.freecodecamp.org/" target="_blank" rel="noopener noreferrer">freeCodeCamp</a>.</p>

Here is the example:

Check out freeCodeCamp.

How to link

Category: Fixes

←Prev
Early Return (2nd Post)
Next→
Regex to remove empty lines