function debounce(func, wait) {
var timeout;
return function () {
var context = this;
var args = arguments;
if (timeout) clearTimeout(timeout);
timeout = setTimeout(function(){
func.apply(context, args)
}, wait);
}
}
function xxx(){
debounce(function(){
console.log(1)
},1100)
}
<input type="text" oninput="xxx()"/>