JSFiddle - React, Tailwind, and code Playground

by sonusindhu

HTML

<div id="change" style="border:5px solid red;width:300px; height:200px;background-Color:yellow"> </div>

JavaScript

var content = [
  "<a href='resim1a.php'> link 1 </a>",
  "<a href='resim2a.php'> link 2 </a>",
  "insert html content"
];
var msgPtr = 0;
var stopAction = null;

function change() {
  var newMsg = content[msgPtr];
  document.getElementById('change').innerHTML = 'Message: '+msgPtr+'<p>'+newMsg;
  msgPtr++;  
  if(msgPtr==2)
  clearInterval(stopAction); 
}

function startFunction() { stopAction = setInterval(change, 500); }
 window.onload = startFunction;