📅  最后修改于: 2022-03-11 15:02:24.435000             🧑  作者: Mango
var timer;
function onInput() {
clearTimeout(timer);
timer = setTimeout(functionToRunAfter2Seconds.bind(this), 2000);
}
inputElement.addEventListener('input', onInput, false);