#html
<input type="text " id="ip">
##javascript
var oInp = document.getElementById('ip'); var oInp = document.getElementById('ip'); var timer = null; function ajax(e) { console.log(e, this.value); } oInp.oninput = function(e) { var _self = this, _arg = arguments; clearTimeout(timer); timer = setTimeout(function(){ ajax.apply(_self,_arg); },1000) }