1. 首页
  2. 数据库
  3. 其它
  4. js正则限制input只能输入金额

js正则限制input只能输入金额

上传者: 2021-01-16 17:13:36上传 PDF文件 26.13KB 热度 19次
限制input只能输入金额 JS代码: function checkInput(_this) { if (_this.value != '' && _this.value.substr(0, 1) == '.') { _this.value = '0.00' } if (_this.value == '') { _this.value = '0.00' } _this.value = _this.value.replace(/^0*(0\.|[1-9])/, '$1') // 禁止粘贴 _this.value = _this.value.replace(
用户评论