-3

By using a single link, I can make two pages appear, however I haven't been able to get it to work for three. Can anyone help me out and, if so, show your code.

Luiggi Mendoza
  • 85,076
  • 16
  • 154
  • 332

2 Answers2

2

You will have to use JavaScript for that.

HTML code

<a href="#" id="linkId">Click Here</a>

JavaScript code

$('#linkId').click(function(e) {
    e.preventDefault();
    window.open('http://google.com');
    window.open('http://facebook.com');
});
neumino
  • 4,342
  • 1
  • 18
  • 17
0

HTML:

<a href="#" class="yourlink">Click Here</a>

JS:

$('a.yourlink').click(function(e) {
    e.preventDefault();
    window.open('http://yoururl1.com');
    window.open('http://yoururl2.com');
});

window.open also can take additional parameters. See them here: http://www.javascript-coder.com/window-popup/javascript-window-open.phtml

You should also know that window.open is sometimes blocked by popup blockers and/or ad-filters.

Mohammad Dohadwala
  • 301
  • 1
  • 3
  • 10