金钱正则判断

var testmoney = /(^[1-9]([0-9]+)?(\.[0-9]{1,2})?$)|(^(0){1}$)|(^[0-9]\.[0-9](0-9)?$)/;

if(!testmoney.test($input.val())){

      alert('请输入正确的金额');

      return false;

}

猜你喜欢

转载自blog.csdn.net/qq_42566295/article/details/81032416
今日推荐