Describes the legal number intervals for an input field.
Sample Coding for step Attribute in HTML:
Code Explanation for step Attribute in HTML:
<form> tag is used to design a form for user input.
<input> tag is used to getting the number from the user.
type attribute defines the type of element (The value is number)
name attribute defines the name of the element.
step attribute describes the legal number intervals for an input field.
Output for step Attribute in HTML:
The output shows that, if input as 9 then the step attribute displays a warning message as “please enter a valid value. The two nearest valid values are 5 and 10".
If input as 15 the step attribute accepts that value because 15 is a multiplication of step value 5.After click the submit button the result is shows in URL as point=15, because the form has been submitted.
Browser Support for step Attribute in HTML:
6.0
10.0
16.0
5.0
10.6
Tips and Notes
The step attribute may be used together with the max and min attributes to create a range of legal values.
The step attribute works with the following input types: number, range, date, datetime, datetime-local, month, time and week.
step Attributeinput type number step decimalinput type number max lengthhtml5 type rangehtml input type number min maxhtml input step decimalinput type number default valueinput type number min lengthinput min max not workinghtml attributeshtml tutorialshtml editorhtml codehtml formhtmltutorialhtml colorhtml color codeshtml tablehtml imghtml5html code for websitehtml and csshtml programshtml websitefree html editorhtml5 tutorialwysiwyg html editorhtml tutorial pdfhtml converterphp tutorialhtml examplehtml tutorialcss tutorialhtml csshtml tagshtml basicscode htmlhtml onlinehtml mailtohtml langhtml tags list