<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