Javascript examples for DOM HTML Element:Input Time
The step property sets or gets the step of a time field, which identifies the legal number intervals for seconds or milliseconds in a time field.
For example: if step="2", legal numbers could be 0, 2, 4, etc.
Set the step property with the following Values
Value | Description |
---|---|
number | Sets the legal number intervals in the time field. |
A Number, representing the legal number intervals for seconds or milliseconds
The following code shows how to change the legal number intervals for seconds in a time field:
<!DOCTYPE html> <html> <body> Time: <input type="time" id="myTime" value="16:32:55"> <button onclick="myFunction()">Test</button> <script> function myFunction() {// w w w.j a v a2 s . c o m document.getElementById("myTime").stepUp(); } </script> </body> </html>