JSFiddle - React, Tailwind, and code Playground

by Michael Geary

HTML

<button onclick="start()">Start</button>

JavaScript

var targets = [
	'http://www.stackoverflow.com/',
	'https://developer.mozilla.org/en-US/',
	'http://www.w3fools.com/'
];

var iTarget;

function nextTarget(){
	window.open( targets[iTarget], 'target' );
	if( ++iTarget >= targets.length ) {
		iTarget = 0;
	}
}

function start() {
	iTarget = 0;
	nextTarget();
	setInterval( nextTarget, 5000 );
}