HTML | DOM Input DatetimeLocal stepDown() Method
The Input DatetimeLocal stepDown() method in HTML DOM is used to decrements the value of the Local datetime field by a specified number. It can only be used on the Minutes. Years, months, days, hours, seconds or milliseconds are not affected by the stepDown() method.
Syntax
datetimelocalObject.stepDown(number)
Parameters: It contains single parameter number which is used to specify the amount of minutes the local datetime field should decrease.
Below program illustrates the DatetimeLocal stepDown method in HTML DOM:
Example: This example use stepDown() method to decrease the value of minutes by 2.
<!DOCTYPE html> < html > < head > < title > Input DatetimeLocal stepDown() Method </ title > </ head > < body style = "text-align:center;" > < h1 style = "color:green;" > GeeksforGeeks </ h1 > < h2 style = "font-family: Impact;" > Input DatetimeLocal stepDown() Method </ h2 > < input type = "datetime-local" id = "test_DatetimeLocal" > < p > To decrease the value of the datetimeLocal field by 2minutes, double click the "Update" button. </ p > < button ondblclick = "My_DatetimeLocal()" > Update </ button > <!-- Script to use stepDown() method --> < script > function My_DatetimeLocal() { document.getElementById("test_DatetimeLocal").stepDown(2); } </ script > </ body > </ html > |
Output:
After clicking the button
Supported Browsers: The browser supported by Input DatetimeLocal stepDown() method are listed below:
- Apple Safari
- Internet Explorer 12.0
- Google Chrome
- Opera
Recommended Posts:
- HTML | DOM Input Range stepDown() Method
- HTML | DOM Input Date stepDown( ) Method
- HTML | DOM Input Time stepDown() Method
- HTML | DOM Input Week stepDown() Method
- HTML | DOM Input Month stepDown() Method
- HTML | DOM Input Number stepDown() Method
- HTML | DOM Input DatetimeLocal stepUp() Method
- HTML | DOM Input DatetimeLocal value Property
- HTML | DOM Input DatetimeLocal max Property
- HTML | DOM Input DatetimeLocal min Property
- HTML | DOM Input DatetimeLocal Object
- HTML | DOM Input DatetimeLocal name Property
- HTML | DOM Input DatetimeLocal required Property
- HTML | DOM Input DatetimeLocal disabled Property
- HTML | DOM Input DatetimeLocal readOnly 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.