js input框限制输入为数字并限制长度
<input type="number" name="price" id="priceVal" placeholder="请输入价格" oninput="if(value.length>10)value=value.slice(0,10)"/>
取值:
price.value
<input type="number" name="price" id="priceVal" placeholder="请输入价格" oninput="if(value.length>10)value=value.slice(0,10)"/>
取值:
price.value