I have tried to restrict users in HTML text box to insert only 4 digit numbers 0-9.
I have tried as follows but it restrict only to allow two digit numbers.
<input type="text" name="pincode" maxlength="4" id="pin" pattern="^0[1-9]|[1-9]d$" required/>
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…