- input 类型为number时出现右侧出现加减按钮
解决:
/* 谷歌 去掉input加减按钮 */
input::-webkit-outer-spin-button, input::-webkit-inner-spin-button {
-webkit-appearance: none;
appearance: none;
margin: 0;
}
/* 火狐 */
input{
-moz-appearance:textfield;
}
- 设置input的边框颜色
解决:outline-color: 色号
3.限制只能输入正数(可以输入一个小数点)
if(!(/(^[0-9]\d*$)/.test(value))) {
alert('请输入正整数');
this.valueText = null
}