input 的onkeyup,只能输入数字
作者:互联网
<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,'')}" >
标签:onkeyup,input,数字,输入,只能 来源: https://blog.csdn.net/qq_39822451/article/details/101106688