I don't know what is the code for opening links in a new tab, I only know the code to open links in the current tab, can you give me the code?
Asked
Active
Viewed 67 times
3 Answers
1
You can simply use window.open("url") with JavaScript to open a link in a new tab.
You can also use target="_blank" within the html tag as well if you don't want to use JS.
Scollier
- 575
- 6
- 19
0
In the element put target="_blank" so for example:
<a class="your-classes" href="https://yoursite.com/here" target="_blank">
josephvictory
- 141
- 6
0
A target attribute with the value of “_blank” opens the linked document in a new window or tab.
<a href="https://www.sitename.com" target="_blank">blablabla</a>
Vinula Senarathne
- 39
- 1
- 8