How to open link in new tab in same group in chrome from code?

Viewed 124

Chrome gives the option to open links in new tab in same group.

I want to open an a tag link in my website in a new tab in the same group in chrome. How can this be done from HTML code?

1 Answers

It should work if you set the target attribute to _blank, which tells the browser to open the link in a new tab/window, depending on the browser's settings. I tried to open a link from a website that was in a chrome tab group and the new open tab was then in the same tab group by default.

If you do that don't forget to add the rel attribute set to noreferrer noopener to prevent possible malicious attacks from the pages you link to.

Here is an example from freecodecamp.org:

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

Here is the link to that tutorial from freecodecamp.

Related