Skip to content

Open multiple tabs with one link | JavaScript code

For example, we want to open 2 URLs ( and in a different tab with one link click. You can do it in 2 ways defining in a tag or using JavaScript.

But in both cases, you have to use a method.

Open multiple tabs with one link Examples

Here is a basic implementation in JavaScript-

	<a href="#" onclick="'');'');">Click to open Google and Yahoo</a>


Window open method in HTML tag


	<a href="#" onclick="yourlink()">Click Here</a>


		function yourlink() {

			var locs = ['', ''] 

			for (let i = 0; i < locs.length; i++) {[i])}



Open multiple tabs with one link

Note: Unblock the pop-up windows for your browser and the code could work.

Do comment if you have any doubts or suggestions on this HTML topic.

Note: The All HTML Examples codes are tested on the Firefox browser and the Chrome browser.

OS: Windows 10

Code: HTML 5 Version

1 thought on “Open multiple tabs with one link | JavaScript code”

  1. Is there any way that the user does not need to do the unblock the popup windows for the browser and still multiple tabs could open?
    Thanks in advance.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.