<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>