input输入框只能输入数字而且开头不能为零

时间:2021-11-05 20:24:56

<div class="input-choseNum">
<input type="number" id="inp-chooseNum" oninput='this.value=this.value.replace(/^[0]+[0-9]*$/gi,"")' maxlength="5" />
<span class="sureChoose">确定</span><span class="closeChoose">取消</span>
</div>