Open multiple links at once using jQuery script - Javascript jQuery

Javascript examples for jQuery:Link

Description

Open multiple links at once using jQuery script

Demo Code

ResultView the demo in separate window

<html>
 <head> 
  <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script> 
  <script>
$(document).ready(function() {
    var linksArray =['https://www.your server.com','http://www.facebook.com','http://www.java2s.com'];
    var i;
    $('#open').click(function() {
      for( i=0; linksArray.length > i; i++){
        window.open(linksArray[i]);
      }//from  www . jav  a  2  s .c  o m
    });
});

      </script> 
 </head> 
 <body> 
  <button id="open" class="button">Open Tabs</button>  
 </body>
</html>

Related Tutorials