Skip to content
← Back to Community
HTML Link Open in a New Tab
Profile icon
IOP3

HTML Link Open in a New Tab

Since when you use the <a> tag for links and you press on one, it will replace the webpage with where the link led you too.


I'm wondering is there a way to open the link in a new tab, so it doesn't replace the old tab?

@IcingHackz

Answered by OldWizard209 [earned 5 cycles]
View Answer
Voters
Profile icon
JeremiahCook3
Profile icon
LegendaryWolf
Profile icon
IOP3
Comments
hotnewtop
Profile icon
OldWizard209

You can use the target attribute and set it to blank:

<p>Go to <a href="https://www.youtube.com/" target="_blank">YouTube</a>.</p>

This will open on a New Tab.

Profile icon
IOP3
Profile icon
OldWizard209
Profile icon
MasonBond1

@IOP3 'tag'

Profile icon
MasonBond1

@OldWizard209 ':insert unhappy face:'

Profile icon
KSUDEE

button name

Profile icon
KSUDEE

I said for button

Profile icon
KSUDEE

@KSUDEE I said for the button

Profile icon
LegendaryWolf

I had the same question! ty

Profile icon
tussiez

A Solution

<a href=" https://www.youtube.com/watch?v=dQw4w9WgXcQ" target="_blank">Click here for free robux</a>
Profile icon
SameeraMurthy

The Solution

Use the target attribute to open links in a new tab.
Like this:

<a href="https://google.com" target="_blank">Click Here!</a>

Hope this helped

Profile icon
RYANTADIPARTHI

Solution

you have to use target. You can assign it to blank, and it opens it up.

<a href="SOMELINK" target="blank">Link</a>

like that.
That should work