让输入框只能输入正整数

 

<input type='text' onkeyup="value=value.replace(/^(0+)|[^\d]+/g,'')">

 

让输入框只能输入带小数点的数值

<input type="text" name="operate" class="layui-input" onkeyup="if(isNaN(value))execCommand('undo')" onafterpaste="if(isNaN(value))execCommand('undo')" />

 

相关文章:

  • 2021-11-28
  • 2022-03-06
  • 2021-07-31
  • 2022-01-12
  • 2022-01-29
  • 2022-01-14
猜你喜欢
  • 2021-12-25
  • 2022-01-22
  • 2022-03-09
  • 2022-12-23
相关资源
相似解决方案