Home SEO Tools FAQs Guest post Contact Donate

Open multiple links / windows in a single click

| 38 comments

A reader asked if she can make a navigation tab open more than one link when clicked. The answer is YES it can be done, with the help from a small Javascript.

(Now if you came here looking for a way YOU can open multiple links on pages you visit, try Snap Links, a  Firefox addon.)

multiple links

First let’s look at an HTML code for a regular anchor tag <a>:

<a href="YOUR_URL" target="_blank">Link text</a>

When clicked, this code will open YOUR_URL in a new window/tab.

To add another link, just add the code below before the closing bracket “>” in the opening tag:

onclick="window.open(&quot;YOUR_2nd_URL&quot;);"

It will open YOUR_2nd_URL in a second new window/tab. To add more links, simply add more window.open(); before the closing quotation mark.

So if you were to open three links, your anchor will look like this:

<a href="YOUR_URL" target="_blank" onclick="window.open(&quot;&quot;YOUR_2nd_URL&quot;&quot;); window.open(&quot;&quot;YOUR_3rd_URL&quot;&quot;);">Link text</a>

This is an example of an anchor that opens three links (in three windows or tabs) in a single click:

<a href="http://bloggersentral.blogspot.com/" target="_blank" onclick="window.open(&quot;http://www.tourism.gov.my/&quot;); window.open(&quot;http://www.tic.kelantan.gov.my/&quot;);">This anchor opens three links in a single click</a>

Now see the code in action, click on it and see what happens.

This anchor opens three links in a single click

Before you apply this new trick, do take into account your readers’ would be reactions. Unless forewarned, I personally would feel tricked if say three windows/tabs pop up when I click something.

Enjoy!

38 comments to "Open multiple links / windows in a single click"

juk November 21, 2009 3:10 PM    

Salam ziarah. Blog anda sgt menarik. Jemputlah dtg ke blog saya pula. Jom kita saling jadi follower? Buat MOU, OK? Thanks.

Zuki (zukidin.blogspot.com)

Termite information December 2, 2009 8:33 PM    

I've been trying to find an answer to this but I'm not sure how to word it correctly. What I'm trying to do is highlight a group of links and then have the set of links open in new tabs.

Thanks for the info! I am looking for this.glad to see your post!

Greenlava December 3, 2009 7:42 PM    

Termite information,
I think FireFox have an addon specially for that. Try seacrh for it.

Logo Designs,
You're welcome

Canada provinces December 18, 2009 12:08 AM    

So, on Column A I have multiple URLs. How do I open all of them at the same time? Without having to click on each and every single URL. Thanks.

Greenlava December 18, 2009 12:14 AM    

Canada provinces,
Try Snap Links FireFox addon.

Ozone depletion January 3, 2010 5:14 PM    

Brilliant. Simple. Insanely useful. Add this to yesterday's sweet Tab Scope and you've just given Firefox two big kicks in the productivity pants. Snap Links is free

zahid June 2, 2010 6:40 PM    

Perfect . I just found what i wanted to do ;) . Keep going towards success ...

Greenlava June 4, 2010 12:24 PM    

@zahid
Thanks for the encouraging words :)

seema October 11, 2010 7:29 PM    

Good One..............

johnnieq December 16, 2010 7:06 AM    

Pretty neat script. I tried the "This anchor opens three links in a single click" and it works great. I do not want the shortcut on a web page, I'd like it on my desktop. Is there a way to do this? I tried saving the link to my Desktop and running it, but it only opens the first site.

Greenlava December 16, 2010 1:39 PM    

@johnnieq
There a simple trick for this -use bookmarks.
You store those links in one bookmark folder. To open all of them at once, Ctrl+Click the folder and voila!

beads February 15, 2011 10:01 AM    

This is a great post it was very informative. I look forward in reading more of your work. Also, I made sure to bookmark your website so I can come back later. I enjoyed every moment of reading it

Greenlava February 15, 2011 1:26 PM    

@beads
Glad you've enjoyed it. There are a lot more tutorials here, you can easily find them using the search bar.

old_trafford February 23, 2011 5:52 AM    

Hi Admin, I try this code..but just 1 link open when i click.How to open three link with 1 link.can you help .

old_trafford February 23, 2011 6:17 AM    

hi admin i succesful for this trick.. this trick done when view in publish.. cannot work when in preview in draf..tq for this..

cd April 24, 2011 1:09 PM    

need help, i wan to make a pictures as link, after that if people click it, will open multiple links,

Greenlava April 24, 2011 1:45 PM    

@cd
Replace the Link Text with your picture source, i.e replace
"This anchor opens three links in a single click"
with:
[img src="PUT YOUR PICTURE URL HERE"]

Anonymous,  July 28, 2011 5:31 AM    

very good , but i Need to open them in the same window and in tabs,help

Greenlava July 31, 2011 6:30 PM    

@Anonymous
Whether they open in new windows or tabs depend on your browser setting.

mixse August 3, 2011 2:47 PM    

ok thanks for great post.i got it.its working now

dann,  August 20, 2011 7:23 PM    

hi is there a way to open this three webpage in an single page

Greenlava August 21, 2011 1:58 AM    

@danne.
I'm afraid that's not possible :(

Anonymous,  September 6, 2011 10:08 PM    

ok thanks for great post.i got it.its working now

Ifat November 30, 2011 11:14 PM    

thanks for this trick :)

Titanic Facts November 30, 2011 11:16 PM    

that's cool, really cool! I've never thought about this one. Now I can use it to use it on my blog to open more than one related site. thanks!!!!!!

ARS November 30, 2011 11:20 PM    

can i use it on frame?

sulthan December 24, 2011 2:43 AM    

salaam [ peace be upon you ]

superb.. tricks

Muhd Firdaus January 15, 2012 9:35 PM    

hi greenlava, can i know how to separate that onclick javascript with html alink? tq

Greenlava January 16, 2012 7:14 PM    

@Muhd Firdaus
Sorry but I don't quite get what you mean. Could you clarify?

Dieyna February 23, 2012 10:23 AM    

Thanks... It's working... Thanks a lot again...

Rahul Kashyap March 3, 2012 3:35 PM    

thanks good work

Virtual Books Library March 9, 2012 7:34 PM    

Thanks !

sania zara April 14, 2012 8:55 PM    

Hello, I love reading through your blog, I wanted to leave a little comment to support you and wish you a good continuation. Wish you best of luck for all your best efforts.by shahchats(java games)

rezki May 12, 2012 2:30 AM    

great code. it will help me to boost my page view blog. thanks bro

Anonymous,  May 14, 2012 8:26 PM    

very useful stuff.

lemonadeflirt May 15, 2012 12:35 PM    

hi greenlava i tried to put that html in blogger post but when i save it and click on it, it only opens a single window and when i tried to edit it again all html was gone rather than

href="http://bloggersentral.blogspot.com/" target="_blank">This anchor opens three links in a single click

please help

Greenlava May 17, 2012 9:11 PM    

@lemonadeflirt
The trick is to never switch to Compose mode after you put in the code.

We love to hear from you! Leave us a comment.

To ensure proper display, HTML/XML/Javascript need to be escaped first using this escape tool. Then paste the escaped code here.

If your question is unrelated to this article, please post on our Facebook page.

Pls share this page

Get this
Click to go to top Click to comment