Dustin Clark
Dustin Clark

Reputation: 92

Open multiple links with a single click

I want a single click to open multiple links NOT as popups. I understand you cannot force a link to open in a tab but a solution that used to exist no longer behaviors ideally.

Main solution that is out there: http://www.w3schools.com/jsref/tryit.asp?filename=tryjsref_win_open6

function myFunction() {
    window.open("http://www.google.com/");
    window.open("http://www.stackoverflow.com/");
}

This works exactly as I would want in Firefox, and probably older versions of Chrome. The current version of Chrome opens the first link in the new tab and then treats all preceding links as popups.

There are also Chrome specific solutions out there and I do NOT want that, for obvious browser support reasons.

Upvotes: 2

Views: 4461

Answers (1)

carlodurso
carlodurso

Reputation: 2894

This looks to be working in Chrome:

<a href="http://www.google.com/" onclick="window.open('http://www.stackoverflow.com/');
return true;">multiopen</a>

Although, I'm sure there are more elegant ways to tailor this solution.

Source: How to make a link open multiple pages when clicked

Upvotes: 1

Related Questions