设置输入框之只能输入正整数,同时,其长度最大只有3位

 

<input type="text" maxlength="3" placeholder="请输入数量,最大 999" onkeyup="value=value.replace(/^(0+)|[^\d]+/g,'')">

 

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-02-11
  • 2021-08-05
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2021-06-08
  • 2022-12-23
  • 2021-08-06
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案