HTML | DOM Input DatetimeLocal step Property
The Input DatetimeLocal Step property in HTML DOM is used to set or return the value of the step attribute of a local datetime field. The Input Step attribute can be used for specifying the legal number intervals for seconds or milliseconds in a local datetime field. The step property cannot be used to affect the days, months, years, hours or minutes.
Syntax:
- It returns the Input DatetimeLocal Step property.
datetimelocalObject.step
- It is used to set Input DatetimeLocal Step property.
datetimelocalObject.step = number
Property Values: It contains single property value number which is used to specify the legal number intervals for seconds or milliseconds.
Below program illustrates the DatetimeLocal step property in HTML DOM:
Example: This example changes the legal number intervals for seconds in a local date field.
<!DOCTYPE html> <html> <head> <title> HTML DOM Input DatetimeLocal step Property </title> </head> <body style="text-align:center;"> <h1 style="color:green;"> GeeksforGeeks </h1> <h2 style="font-family: Impact;"> Input DatetimeLocal step Property </h2> <input type="datetime-local" id="Test_Datetime"> <p> To update the step, double click the "Change Step" button. </p> <button ondblclick="My_DatetimeLocal()"> Change Step </button> <p id="test"></p> <script> function My_DatetimeLocal() { document.getElementById("Test_Datetime").step = "5"; document.getElementById("test").innerHTML = "The step attribute has been " + "changed to '5'."; } </script> </body> </html> |
Output:
Before clicking the button:

After clicking the button:

Supported Browsers: The browser supported by Input DatetimeLocal step property are listed below:
- Apple Safari
- Internet Explorer 10.0
- Firefox
- Google Chrome
- Opera
Recommended Posts:
- HTML | DOM Input DatetimeLocal name Property
- HTML | DOM Input DatetimeLocal min Property
- HTML | DOM Input DatetimeLocal max Property
- HTML | DOM Input DatetimeLocal value Property
- HTML | DOM Input DatetimeLocal disabled Property
- HTML | DOM Input DatetimeLocal form Property
- HTML | DOM Input DatetimeLocal type Property
- HTML | DOM Input DatetimeLocal required Property
- HTML | DOM Input DatetimeLocal readOnly Property
- HTML | DOM Input Number step Property
- HTML | DOM Input Month step Property
- HTML | DOM Input Time step Property
- HTML | DOM Input Week step Property
- HTML | DOM Input Range step Property
- HTML | DOM Input Date step Property
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to contribute@geeksforgeeks.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.



