0

We Know That we can redirect to web pages using location.href or location.replace but I wanted to ask that can We open a new webpage in a new tab using JavaScript.

  • 1
    Does this answer your question? [Open a URL in a new tab (and not a new window)](https://stackoverflow.com/questions/4907843/open-a-url-in-a-new-tab-and-not-a-new-window) – Adesh Kumar Jun 10 '20 at 04:38
  • Does this answer your question? [Open URL in new window with JavaScript](https://stackoverflow.com/questions/14132122/open-url-in-new-window-with-javascript) – Always Helping Jun 10 '20 at 04:41

2 Answers2

3

Try

window.open(url, '_blank')

where url is the link you want to open

Rain.To
  • 504
  • 2
  • 7
0

You can do it using window.open(url)

for more details: https://developer.mozilla.org/en-US/docs/Web/API/Window/open

Sahandevs
  • 1,120
  • 9
  • 25