οninput="value=value.replace(/^\D*(\d*(?:\.\d{0,5})?).*$/g, '$1')"
本文是可以精确到小数点后5位
只允许输入数字(整数:小数点不能输入)
<input type="text" οnkeyup="value=value.replace(/[^\d]/g,'')" >
开头不能为0,且不能输入小数
<input type="text" οnkeyup="value=value.replace(/[^\d]/g,'').replace(/^0{1,}/g,'')" >