首页 > 技术文章 > 只允许数字(清除空格和字母)

mangwusuozhi 2019-07-25 16:03 原文

页面中输入框只允许输入数字

onkeyup="this.value=this.value.replace(/[^0-9.]/g,'')"

 

推荐阅读