Input Time step Property
Example
Change the legal number intervals for seconds in a time field:
document.getElementById("myTime").step = "10";
Try it Yourself »
Definition and Usage
The step property sets or returns the value of the step attribute of a time field.
The step attribute specifies the legal number intervals for seconds or milliseconds in a time field (does not apply for hours or minutes).
Example: if step="2", legal numbers could be 0, 2, 4, etc.
Tip: The step attribute is often used together with the max and min attributes to create a range of legal values.
Browser Support
Property | |||||
---|---|---|---|---|---|
step | Yes | 10.0 | Yes | Yes | Yes |
Note: The <input type="time"> element does not show as any time field in Firefox.
Syntax
Return the step property:
timeObject.step
Set the step property:
timeObject.step = number
Property Values
Value | Description |
---|---|
number |
Specifies the legal number intervals in the time field.
For seconds:
For milliseconds:
|
Technical Details
Return Value: | A Number, representing the legal number intervals for seconds or milliseconds |
---|
More Examples
Example
Change the legal number intervals for milliseconds in a time field:
document.getElementById("myTime").step = ".050";
Try it Yourself »
Example
Get the legal number intervals for seconds in a time field:
var x = document.getElementById("myTime").step;
Try it Yourself »
Related Pages
HTML reference: HTML <input> step attribute
❮ Input Time Object