Change the legal number intervals for seconds in a time field:
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.
The step property is supported in all major browsers.
Note: The step property is not supported in Internet Explorer 9 and earlier versions.
Note: The <input type="time"> element is not supported in Internet Explorer or Firefox.
Return the step property:
Set the step property:
Value | Description |
---|---|
number |
Specifies the legal number intervals in the time field.
For seconds:
For milliseconds:
|
Return Value: | A Number, representing the legal number intervals for seconds or milliseconds |
---|
Change the legal number intervals for milliseconds in a time field:
Get the legal number intervals for seconds in a time field:
The result of x will be:
HTML reference: HTML <input> step attribute