In this post, you will learn how to limit an HTML input box so that it only accepts numeric input.
Step-1
Make input box type text to number
Step-2
Use Attributes min and max to limit the number, Check the below example.
Below HTML Code
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | <!DOCTYPE html> <html> <head> <title>HTML input number</title> </head> <body> <form action = "" method = "get"> Enter any number between 1 to 99: <input type="number" name="num" min="1" max="99"><br> <input type="submit" value="Submit"> </form> </body> </html> |