input只能输入数字并限制长度
<style>
/*在chrome下移除input[number]的上下箭头*/
input::-webkit-outer-spin-button,
input::-webkit-inner-spin-button{
-webkit-appearance: none !important;
margin: 0;
}
/*在firefox下移除input[number]的上下箭头*/
input[type="number"]{-moz-appearance:textfield;}
<style>
<input type="number" oninput="if(value.length>5)value=value.slice(0,5)">