JS限制输入框只能输入数字

限制输入框只能输入数字(使用正则) let reg=/[/D]/g; input.oninput=function(){ this.value=this.value.replace(reg,''); } /D: 匹配数字 /d: 匹配除数字之外的任何
相关文章
相关标签/搜索