<input onkeyup="value=value.replace(/[^\d]/g,'')"> 转载于:https://www.cnblogs.com/zhangxiangdong/p/9372098.html