input 中设置只能是数字

<input onkeyup="this.value=this.value.replace(/[^0-9-]+.[^0-9-]+/,'');" id="wholesalePrice"  type="text"/>
原文地址:https://www.cnblogs.com/riyueqian/p/11559381.html