<head> <script type="text/javascript"> function checkthis() { var t=document.forms[0].elements[0]; var reg=/^\d+[.]?\d{1,3}$/; alert(reg.test(t.value)); } </script> </head> <body> <form> <input type="text" id="txt" /> <input type="button" value="检查" onclick="checkthis();" /> </form> </body>
js限制小数点后3位
猜你喜欢
转载自www.cnblogs.com/QW-lzm/p/12408059.html
今日推荐
周排行