`

文本框只能输入数字

 
阅读更多
只允许输入数字(不带小数点的)
<input type="text" onkeyup="value=value.replace(/[^\d]/g,'')" name="numSort">


只允许输入数字(带小数点的)
<input type="text" onkeyup="value=value.replace(/[^\d\.]/g,'')" name="numSort">

分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics