JSFiddle - React, Tailwind, and code Playground
HTML
<input id="foo" />
<div>You stopped typing 1 second ago</div>
CSS
div {
display: none;
}
JavaScript
var timer;
$('#foo').keypress(function() {
clearTimeout(timer);
timer = setTimeout(function() {
$('div').fadeIn('fast').delay(1000).fadeOut('fast');
}, 800);
});