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 use JavaScript.

But in both cased 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 and suggestion 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

Leave a Reply

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