input 只允许输入数字

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

原文地址:https://www.cnblogs.com/oskyhg/p/6802266.html