只允许数字(清除空格和字母)

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

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

原文地址:https://www.cnblogs.com/mangwusuozhi/p/11244888.html