How to use Step Attribute in HTML5

This article describe about Step Attribute in HTML5.
  • 1910

<input> step Attribute

This attributes specifies the regular number of increment or intervals for <input> element.

Example:

If step="2", regular numbers could be -2, 0, 2, 4, etc.

Note: In this attributes max and min is also specified for create a range of regular interval values.

Note2: This  attribute works with these input types: number, range, date, datetime, month, time and week, datetime-local.

Example:

<!DOCTYPE html>
<html>
<body>
<form action="default.aspx">
<input type="number" name="points" step="2" />
<input type="submit" />
</form>
</body>
</html>

Output

step attribute fig5.jpg

step fig6.jpg

HTML5 <input> Tag

 

Tag Description
<form> It is define the HTML form for user input.
<input> It is define input control

Further Readings

You may also want to read these related articles :

Ask Your Question 

Got a programming related question? You may want to post your question here

Programming Answers here

© 2019 DotNetHeaven. All rights reserved.