1.只能为大于等于0的数字
<input type="text" onkeyup="value = value.replace(/[^\d\.]/g, '')">
2.只能为大于0的数字
<input type="text" onkeyup="value = value.replace(/^0+|[^0-9\.]/g, '')">
3.只能为字母(大小写都可以)
<input type="text" onkeyup="value = value.replace(/[^a-zA-Z]/g, '')">
4.只能为字母(大写都可以)
<input type="text" onkeyup="value = value.replace(/[^A-Z]/g, '')">
5.只能为字母(小写都可以)
<input type="text" onkeyup="value = value.replace(/[^a-z]/g, '')">
6.只能输入中文
<input type="text" onkeyup="value = value.replace(/[^\u4e00-\u9fa5]/g, '')">
7.只有两位小数
<input type="text" onkeyup="value = value.replace(/^(\-)?(\d+)?(\.\d{0,2})?.*$/, '$1$2$3')">