maksim-korzhov
12/7/2017 - 5:27 PM

deffered_event

<input type="text" id="test-input" />

<script>
// Send request only when user stop typing
var textInput = document.getElementById("test-input");

var timer = null;

textInput.onkeydown = function(e) {
  clearTimeout(timer);
  
  timer = setTimeout(function() {
    console.log("Input value: " + textInput.value);
  }, 1000);
}
</script>