只能输入数字:
<input name="cdw" type="text" onpropertychange='if(/[^\-?\d*\.?\d{0,2}]/.test(this.value)) this.value=this.value.replace(/[^\-?\d*\.?\d{0,2}]/,"")'>
 只能输入整数:
<input name="cdw" type="text" onpropertychange='if(/[^\-?\d*]/.test(this.value)) this.value=this.value.replace(/[^\-?\d*]/,"")'>

相关文章:

  • 2021-07-11
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2021-06-25
  • 2022-12-23
  • 2022-12-23
  • 2021-11-18
  • 2021-11-22
  • 2022-12-23
相关资源
相似解决方案