1.匹配一位小數(shù) <input type="text" onkeyup="value=value.replace(/[^\d\.]/g, '').replace(/(\.\d).*/g, '$1')" value=""/>在第二個replace 用 \d{2} 小數(shù)點后兩位2.匹配整數(shù).replace(/[^\d\\]/g,'');
在第二個replace 用 \d{2} 小數(shù)點后兩位2.匹配整數(shù).replace(/[^\d\\]/g,'');
Powered by: BlogJava Copyright © 朱杰兵