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.

2

2 Answers 2

3

Try

window.open(url, '_blank')

where url is the link you want to open

Sign up to request clarification or add additional context in comments.

Comments

0

You can do it using window.open(url)

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

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.