JSFiddle - React, Tailwind, and code Playground
HTML
<input id="foo">
<div id="myDiv"></div>
JavaScript
$scope = {};
//on keydown...
document.getElementById("foo").onkeydown = function() {
clearTimeout( $scope.delay );
$scope.delay = setTimeout( $scope.lookup, 1000);
document.getElementById("myDiv").innerHTML = "Someone is typing";
}
$scope.lookup = function() {
document.getElementById("myDiv").innerHTML = "Nobody is typing";
}
$scope.lookup();