Input 只能输入正数以及2位小数点

<input onkeyup="this.value= this.value.match(/\d+(\.\d{0,2})?/) ? this.value.match(/\d+(\.\d{0,2})?/)[0] : ''" type="text" />

posted @ 2019-03-28 17:16  常威打来福  阅读(508)  评论(0编辑  收藏  举报