I have an input field, that I’d like to restrict the value to an integer only.
I am using the plug-in TexoTela jQuery numeric to do this, which works well.
What I’m ideally wanting though, is to restrict this value to lets say 30, so users cannot enter values above this. (can only enter between 0 and 30)
Could I do this with jQuery?
Thanks
Using HTML5, you could use an
inputelement with typenumber:— See Demo —
Alternatively, if you need to support pre-HTML5 browsers, as one of your comments suggests, you could use a
selectelement:— See Demo —