JSFiddle - React, Tailwind, and code Playground

HTML

<script>
var seconds = 0, stop = 60, counterStarted = false, counter;
function myFunction(){
	if(counterStarted === false){
  	counterStarted = true;
  	counter = setInterval(function(){
    	if(seconds <= stop){
      	document.getElementById('timer').innerHTML = seconds;
      	seconds++;
      }else{
      	document.getElementById('textarea').setAttribute("disabled", "disabled");
      	clearInterval(counter);
      	counterStarted = false;
        seconds = 0;
      }
    },1000)
  }
}
</script>


<div id="timer"></div>
  <p>
Text for typing test will go here.  </p>
<textarea id="textarea" rows="14" cols="150" placeholder="Start typing here..." onkeypress="myFunction()"></textarea>