只能輸入正整數
<input type="text" name="speed"
onkeyup="value=value.replace(/^(0+)|[^\d]+/g,'')"
placeholder="請輸入車輛速度">
限制最大長度
<input type="text" maxlength="5" />
只能輸入正整數
<input type="text" name="speed"
onkeyup="value=value.replace(/^(0+)|[^\d]+/g,'')"
placeholder="請輸入車輛速度">
限制最大長度
<input type="text" maxlength="5" />