首页 > 技术文章 > 限制input输入两位小数

peter-web 2020-08-06 11:27 原文

that.value = that.value.replace(/^(\-)*(\d+)\.(\d\d).*$/, '$1$2.$3'); //只能输入两个小数

https://blog.csdn.net/qq_24935119/article/details/96437971

https://www.jb51.net/article/83398.htm

推荐阅读