This content originally appeared on CodeSource.io and was authored by Ariessa Norramli
In this article, you will learn how to open a link in a new tab in Javascript.
Let’s say you want to open a link to the codesource.io’s homepage.
https://codesource.io/
In order to open a link in a new tab, you can use the window.open()
method.
window.open("https://codesource.io/");
Note: The window.open()
method functions by opening the supplied link in a new tab or window, depending on your browser configuration.
The post How to Open Link in New Tab in Javascript appeared first on CodeSource.io.
This content originally appeared on CodeSource.io and was authored by Ariessa Norramli
Ariessa Norramli | Sciencx (2021-02-18T11:05:32+00:00) How to Open Link in New Tab in Javascript. Retrieved from https://www.scien.cx/2021/02/18/how-to-open-link-in-new-tab-in-javascript/
Please log in to upload a file.
There are no updates yet.
Click the Upload button above to add an update.