js 正则 只能输入数字和小数点后两位

  <input  type="text" oninput="this.value= this.value.match(/\d+(\.\d{0,2})?/) ? this.value.match(/\d+(\.\d{0,2})?/)[0] : ''">

猜你喜欢

转载自blog.csdn.net/gyq04551/article/details/81004846