1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12:
var lastvalue = null; function checkInput() { var value = document.getElementById('yourTextInput').value; if (value != lastvalue) { runAjax(); lastvalue = value; } setTimeout(checkInput, 500); } window.onload = checkInput;