如何填充掩碼後的最後兩位數字?例如:XXXX99
所以,當我在第一個數字鍵應該是1XXX99
jquery輸入掩碼插件
var autoPopulateNo = "\\9\\9" //how to put this after the mask? example XXXX99
$("#number").inputmask({
"mask": "9999" + autoPopulateNo,
clearMaskOnLostFocus: false,
placeholder:"X",
});
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.1.1/jquery.min.js"></script>
<script src="https://s3-us-west-2.amazonaws.com/s.cdpn.io/3/jquery.inputmask.bundle.js"></script>
<form action="">
<div>
<label for="number">Mask</label>
<input id="number" type="text"/>
</div>
</form>
歡迎回來,https://stackoverflow.com/questions/44818443/placeholder-and-value-present-at-the-same-time/44818561#44818561 – TripleDeal
怎麼樣,如果最後兩位數字是99而不是56? – Rick