JSFiddle - React, Tailwind, and code Playground

by mckabue

HTML

<a href="#" target="_blank" id="myLink">myLink</a>

JavaScript

document.getElementById("myLink").onclick = function() {
   document.getElementById("myLink").href="https://www.google.com"; 
  };
  
  
  setTimeout(function(){
  document.getElementById('myLink').click();
  }, 5000);