Reputation: 1
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.
Upvotes: 0
Views: 47
Reputation: 512
Try
window.open(url, '_blank')
where url is the link you want to open
Upvotes: 3
Reputation: 1160
You can do it using window.open(url)
for more details: https://developer.mozilla.org/en-US/docs/Web/API/Window/open
Upvotes: 0