简体   繁体   中英

How can I take input from 1 to 10 only in HTML/JQuery?

How can I take input only 1 - 10 , ( 1,2,3,4,...,10 ) in HTML input tag?

If I enter 9 than the code should not allow me to enter anymore digits. And if I enter 1 than I can only enter 0 as the next digit.

try below mention tag

<input type="number" name="numberInput" min="1" max="10">

you can use
for() {}
Method for iterate input tag.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM