New course! Every coder should learn Generative AI!
Try a free lesson+ 1
Hello friends i want to allow only 5 digits in my input tag how can i do that in html?
Html tag
3 Answers
+ 1
Use
pattern="[0-9]{5}"
or
pattern="\d{5}"
0
<input type="" maxlength="5">