This question already has an answer here:
- Multiple Windows using window.open() 4 answers
I am trying to open two different windows with the click of a button, but when i click the button it opens the same window twice. This is my function:
function flush(form) {
var custid = form.custid.value;
var url1 = "https://www.blabla.com?type=customer&id="+custid;
flushWindow1 = window.open(url1);
var url2 = "https://web.blabla.com?type=customer&id="+custid;
flushWindow2 = window.open(url2);
}
Does anyone know how I can do this?
try open in new window/tab by add parameter
'_blank'
and then focus the window you want by place
window.focus();
behind window you want to focus after open two new windowTry providing second argument to window.open() method, which is the name of the window, if name is different then same url will open in different windows. e.g.
Demo
From : JSfiddle Two windows on a Click