<input type="text" onkeyup="if(/\D/.test(this.value)){this.value='1';}" value="1"> 转载于:https://www.cnblogs.com/lilixing/p/4346407.html