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.
-
1Does this answer your question? Open a URL in a new tab (and not a new window)Adesh Kumar– Adesh Kumar2020-06-10 04:38:22 +00:00Commented Jun 10, 2020 at 4:38
-
Does this answer your question? Open URL in new window with JavaScriptAlways Helping– Always Helping2020-06-10 04:41:42 +00:00Commented Jun 10, 2020 at 4:41
Add a comment
|
2 Answers
You can do it using window.open(url)
for more details: https://developer.mozilla.org/en-US/docs/Web/API/Window/open