<input type="number" min="0" max="100" step="1" οnkeyup="if(this.value.length==1){this.value=this.value.replace(/[^1-9.]/g,'')}else{this.value=this.value.replace(/\D/g,'')}" onafterpaste="if(this.value.length==1){this.value=this.value.replace(/[^1-9]/g,'0')}else{this.value=this.value.replace(/\D/g,'')}" >
限制输入框只能输入正整数
最新推荐文章于 2024-07-03 11:46:28 发布