Back

Explore Courses Blog Tutorials Interview Questions
0 votes
4 views
in Java by (13.1k points)
I was trying to create a button which will redirect to different page using an URL in JavaScript. Can anyone help me with this how I can able to make it work?

1 Answer

0 votes
by (26.7k points)

In able to do that, you can use the window.open() function:

<a onclick="window.open(document.URL, '_blank', 'location=yes,height=600,width=550,scrollbars=yes,status=yes');">

  Intellipaat Page

</a>

This will help you with a page called the Intellipaat page which will open in a new window.

I hope this will help.

Want to know more about Java? Prefer this tutorial on Learn Java.

Want to become a Java Expert? Join Java Certification now!!

Related questions

0 votes
1 answer
0 votes
1 answer
0 votes
1 answer
0 votes
1 answer
asked Mar 31, 2021 in Java by dante07 (13.1k points)
0 votes
1 answer
asked Mar 18, 2021 in Java by sheela_singh (9.5k points)

Browse Categories

...