input 输入框只能输入数字,一行代码解决,兼容谷歌 火狐

<input id="mobile" name="mobile" type="text" onkeyup="this.value=this.value.replace(/[^\d]/g,'');" class="input" placeholder="请填电话或手机号码"  />

猜你喜欢

转载自blog.csdn.net/youxiu326/article/details/83620349