JSFiddle - React, Tailwind, and code Playground

HTML

<input type="text" >

JavaScript

var interval = 1;

setInterval(function(){
   if(interval == 5){
       $('input').hide(); 
       interval = 1; 
   }
   interval = interval+1;
    console.log(interval);
},1000);

$(document).bind('mousemove keypress', function() {
    $('input').show();
    interval = 1; 
});