JSFiddle - React, Tailwind, and code Playground

by jomanlk

HTML

<input type='text' id='text'>

JavaScript

var timer = null;
$('#text').keydown(function(){
       clearTimeout(timer); 
       timer = setTimeout(doStuff, 1000)
});

function doStuff() {
    alert('do stuff');
}