Signup/Sign In
Ask Question
Not satisfied by the Answer? Still looking for a better solution?

Open link in new tab or window

Is it conceivable to open a href link in another tab rather than a similar tab?
<a href=" //your_url_here.html">Link</a>
by

2 Answers

ninja01
You should add the target="_blank" and rel="noopener noreferrer" in the anchor tag.

For example:

<a target="_blank" rel="noopener noreferrer" href="your_url_here">Link</a>

Adding rel="noopener noreferrer" is not mandatory, but it's a recommended security measure.
sandhya6gczb
If you set the target attribute to "_blank", the link will open in a new browser window or a new tab

<!DOCTYPE html>
<html>
<body>

<h1>The a target attribute</h1>

<a href="URL of website" target="_blank"></a>

</body>
</html>

Login / Signup to Answer the Question.