How to Open Link in New Window by using Javascript ?

Share Me

Today now in this blog, I will show you how to open the link in new window by using javascript. Here I would like to take the current page URL and then want open it in a new window.

Now here I will give you a simple and very easy example for open link in new window by using javascipt is in bellow. So you can see the simple example of open url in new window by using by using javascript.

Syntax :, name, specs, replace);

Use :"","mywindow","status=1,toolbar=1");


<!DOCTYPE html>
    <title>javascript open link in new window example -</title>

    <button onclick="getLink();">Click me</button>

    <script type="text/javascript">
        function getLink() {

Read Also : How to Image Validation in Laravel ?

Thank you read.Hope it will help you. Also follow onĀ facebook

About Shahriar Sagor

My name is Shahriar sagor. I'm a developer. I live in Bangladesh and I love to write tutorials and tips that will help to other Developer's. I am a big fan of PHP, Javascript, JQuery, Laravel, Codeigniter, VueJS, AngularJS and Bootstrap from the early stage.

View all posts by Shahriar Sagor →