转自 https://zhidao.baidu.com/question/1829801257322895700.html
<input type="text" onkeyup="var v=this.value||'';v=v.replace(/[^\d]/g,'');v=parseInt(v,10);if(v<50){this.value=50;}else if(v>1000){this.value=1000;}"> <input type="text" onkeyup="var v=this.value||'';if(v.length>4&&!/^9506/.test(v)){this.value='';}">