Search code examples
javascriptjqueryhtmlinputdigit

HTML - Number Input Limit (Go Up/Go Down 10 to 10)


I want when i press up arrow number change (increase) 0-to-10 /then/ 10-to-20 / 20-to-30 I mean 10 to 10. and if you press down arrow, number change (decrease) 10 to 10.

<input type="number" value="0" min="0" max="99999999" />

I don't know JavaScript or jQuery well. couldn't found anything about this in google/stackoverflow. Obviously i haven't any code on JSFiddle.


Solution

  • You want the step attribute. This specifies how far to increase or decrease the number. For example:

    <input type="number" value="0" min="0" max="99999999" step="10" />