JSFiddle - React, Tailwind, and code Playground

by chandings

HTML

<input id="tf"></input>

JavaScript

var dummyString = "I am a choot! ";
var currentIndex = 0;

$('#tf').on('keypress', function(){
	var str = $('#tf').val();
    str = str.slice(0, str.length-1);
    str += dummyString.charAt(currentIndex);
    currentIndex++;
    if(currentIndex >= dummyString.length){
    	currentIndex = 0;
    }
    $(this).val(str);
})