Javascript Open Link in New Window Example




Hi Dev,

In this blog, I will learn you how to open link in new window using javascript. I would like to take the current page URL and open it in a new window.

I will give you simple and easy example for open link in new window using javascipt is bellow. you can see a simple example of open url in new window using in 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() {"","mywindow","status=1,toolbar=1");





It will help you...