Skip to content
Sign upLog in
This post is read-only. Explore Repls and connect with other creators on Community.View Community
The info in this post might be out of date, check out our docs instead. View docs
4

HTML Link Open in a New Tab

icodeletion
icodeletion

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

2 years ago
You are viewing a single comment. View All
2
OldWizard209
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.

2 years ago
1
MasonBond1
MasonBond1

@OldWizard209
':insert unhappy face:'

8 months ago