function check(e) { var re = /^\d+(?=.{0,1}\d+$|$)/ if (e.value != "") { if (!re.test(e.value)) { alert("请输入正确的数字"); e.value = ""; e.focus ...
function check(e) { var re = /^\d+(?=.{0,1}\d+$|$)/ if (e.value != "") { if (!re.test(e.value)) { alert("请输入正确的数字"); e.value = ""; e.focus ...
<input type="text" placeholder="保留到小数点后两位" maxlength="200" onkeyup="num(this)" onpaste="num(this)" /> //输入和黏贴操作时触发 //小数点后两位 function num ...
输入框input只能输入数字和小数点 只允许输入数字(整数:小数点不能输入)<input type="text" onkeyup="value=value.replace(/[^\d]/g,'')" > 允许输入小数(两位小数)<input type ...
只允许输入数字(整数:小数点不能输入)<input type="text" onkeyup="value=value.replace(/[^\d]/g,'')" > 允许输入小数(两位小数)<input type="text" onkeyup="value ...
只允许输入数字(整数:小数点不能输入)<input type="text" onkeyup="value=value.replace(/[^\d]/g,'')" > 允许输入小数(两位小数)<input type="text" onkeyup="value ...
只允许输入数字(整数:小数点不能输入)<input type="text" onkeyup="value=value.replace(/[^\d]/g,'')" > 允许输入小数(两位小数)<input type="text" onkeyup="value ...
<input type="text" class="txt NumText" Width="100px" /> $(function(){ /*JQuery 限制文本框只能输入数字 ...
)) { alert("请输入正确的数字"); e.value = ""; ...