1 value.replace(/[^\d]/g,'') 2.验证只能输入数字和小数,小数且只能输入2位,第一位不能输入小数点 value.replace(/[^\d.]/g,"").replace(/\.{2,}/g,".").replace(".","$#$").replace(/\./g,"").replace("$#$",".").replace(/^(\-)*(\d+)\.(\d\d).*$/,"$1$2.$3"...