原文:JS判断只能是数字和小数点

.文本框只能输入数字代码 小数点也不能输入 lt input onkeyup this.value this.value.replace D g, onafterpaste this.value this.value.replace D g, gt .只能输入数字,能输小数点. lt input onkeyup if isNaN value execCommand undo onafterpas ...

2014-09-04 22:18 0 14389 推荐指数:

查看详情

js判断只能输入数字小数点

JS判断只能数字小数点 1.文本框只能输入数字代码(小数点也不能输入) <input onkeyup="this.value=this.value.replace(/\D/g,'')" onafterpaste="this.value=this.value.replace(/\D/g ...

Tue Jul 18 22:01:00 CST 2017 0 1250
只能输入数字小数点的正则

只能输入数字小数点的正则 <input type="text" autocomplete="off" id="price" autofocus="autofocus" onkeyup="value=value.replace(/[^\d^\.]+/g,'')"> ...

Tue May 11 19:27:00 CST 2021 0 3546
 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM