Monday, November 2, 2015

How to Open multiple links by a single click

Hello fellow Bloggers. A reader just asked about opening more than 1 link by clicking a link. I am presenting down the html code for that. You can open as many links by clicking single anchor text link. All the links will open in new tabs.

To open link in new tab

A regular link can be opened in new tab. Just place target='_blank' after the URL.
Like this
<a href="URL link" target="_blank">Text to Display</a>

To open multiple links in new tabs

To open more than one links just add the following code
onclick="window.open(&quot;YOUR_2nd_URL&quot;);"

Your link html will look like this
<a href="1st Link" onclick="window.open(&quot;2nd_Link&quot;);">Link Text</a> 

Just take this example Blogger SEO by UK . This link will open our homepage in current tab and 2nd link in new tab. But the text shown is one for both link tabs. Down is the html code.
<a href="http://www.blogtipsuk.com/" onclick="window.open(&quot;http://www.blogtipsuk.com/2015/05/how-to-make-money-with-infolinks-on-blogger.html&quot;);">Blogger SEO by UK</a> 

You can add as many links as you like with this code.
Hope its clear for all the readers. Have a good day!

No comments:

Post a Comment