Search code examples
htmlxhtml

In html what's the purpose of using 'step' attribute in input tag?


the purpose of using step attribute in input tag in html?

    input type="number" name="points" min="0" max="100" step="10" value="30"

From the above line minimum length is zero, maximum length is 100, default value is 30 but i can't understand what action doing when assign step="10"


Solution

  • The step attribute specifies the legal number intervals for an element. Example: in your case, step="10", legal numbers could be -10, 0, 10, 20, etc. Still if you can't get it, you can go through this link.

    http://www.w3schools.com/tags/tryit.asp?filename=tryhtml5_input_step