JSFiddle - React, Tailwind, and code Playground

HTML

<button id='recebe-links'>
Link
</button>

JavaScript

(function(view){

var links = ['http://google.com','http://youtube.com','http://imasters.com.br'];
var counter = 0;

$("#recebe-links").on('click',function(e){
	e.preventDefault();
  if(counter === links.length){
  	counter = 0;
  }
    window.open(links[counter],'_blank');

  counter++;
});

})(this);