JSFiddle - React, Tailwind, and code Playground

by svinesh3691

JavaScript

function timer(){
			this.ran = Math.floor(Math.random() * 100) + 1;
			this.cls =  this.ran+'_ocar';
			this.div = '<div class="'+this.cls+'">'+this.cls+'</div>';
      $('body').append(this.div);
      this.run = function(){
          
          thi = this;
          thi.k = 0;
          setInterval(function(){
          console.log(thi.cls);
              $('.'+thi.cls).html(thi.k++);
          },1000);
      }
}
one = new timer();
one.run();
setInterval(function(){
	new timer().run();
},5000)