Open every link in a new window


Iam using the below code to open a link in a new electron window:

$('body').on('click', '.openlink', function () { var url = '' +;,"_blank","height=650,width=1000,frame=true,show=true"); });

However, when I click the button again, the other page opens in the same window that opened. How can I open new button clicks on new windows every time ?


I’m so new to Electron and web stuff in general this could be wrong. But I hope this helps. I too, wanted to open new windows in Electron and found that just by adding "target=‘blank’ " in the link works.


I also found I’m not to sure how it works yet but it does open a new window.


Hello. Thanks for the reply, where exactly do you put target=blank ?


where you need the link. In my case I’m using a nav-bar so I line that works is:
a class=“navbar-item is-hidden-desktop” href=“page1.html” target="_blank"

Of course it does not have to be from a nav-bar (bulma css component) it could be from a menu item. Somewhere you have to tell the program where to go on the a click event or some other function.


It still doesnt work for me man


OK let’s try this:


<p>Open "myWindow" </p>

<button onclick="openWin()">Open "myWindow"</button>
var myWindow;

function openWin() {"", "myWindow", "width=200, height=100");
    myWindow.document.write("<p>This is 'myWindow'</p>");