JSFiddle - React, Tailwind, and code Playground

by Luis Lebolo

HTML

<input id="txt1" type="text" width="300"/>

JavaScript

debugger;
var text = ["I want a smartphone with a big screen", "I don't want a smartphone made by a korean company", "I want a LED TV with high refresh rate"];
var counter = 0;
var elem = document.getElementById("txt1");
setInterval(change, 2000);
function change() {
document.getElementById("txt1").value = text[counter]; //data is the element
         counter++;
    if(counter >= text.length) { counter = 0; }
}