input 经常使用正则

<!-- 只容许输入数字和一位小数点和小数点后两位 而且首位不能为小数点 --> <input type="text" onkeyup="this.value= this.value.match(/\d+(\.\d{0,2})?/) ? this.value.match(/\d+(\.\d{0,2})?/)[0] : ''" > <!-- 只能输入英文 --> <input type="text
相关文章
相关标签/搜索