var timer; function onInput() { clearTimeout(timer); timer = setTimeout(functionToRunAfter2Seconds.bind(this), 2000); } inputElement.addEventListener('input', onInput, false);