JSFiddle - React, Tailwind, and code Playground

HTML

Enter something here <input id="test" type="text">
<p id="result">No result</p>

JavaScript

jQuery(function($){

    var timer;
    $('#test').keypress(function(e){
        $('#result').text('Typing ...');
        
        // clear the timer as keys are still entered
        if(timer) clearTimeout(timer);
        
        // setup the timer
        timer = setTimeout(function(){
            $('#result').text('End typing !');
        }, 2000);
    });
    
});