JSFiddle - React, Tailwind, and code Playground

by Matt Hopkins

HTML

<a id="rotate" href="#" target="TESTWINDOW">Go Button</a>

JavaScript

document.getElementById("rotate").onclick = function() {
  var urls = ['http://google.com', 'http://twc.com', 'http://aol.com', 'http://yahoo.com'];
  var url = urls[Math.floor(Math.random() * urls.length)];
  document.getElementById('rotate').href = url;
  return false;
}