JSFiddle - React, Tailwind, and code Playground

by Andres Abadia

HTML

<script>
var title = ['233249864597', '233209425159', '233201112221', '233546056136', '233266549303', '233209409846','233501345825','233248446422','233546112136','233541006033','233502089334','233552476293','233268222280','233202240898'];


var i = 0;  // the index of the current item to show

var animate = setInterval(function() {  
// setInterval makes it run repeatedly
    document
        .getElementById('fruit')
        .innerHTML = title[i++];   
        // get the item and increment
    if (i == title.length) i = 0;  
    // reset to first element if you've reached the end
}, 15); 


function stop(){

clearInterval(animate);

} 


</script> 


<h1>THE WINNER IS : </h1>
<h1><span id="fruit"></span></h1>

<center><button onclick="stop()">STOP</button></center>


</body>