Javascript examples for DOM HTML Element:Input Month
The stepDown() method increments the MONTHS value of the month field by a specified number.
Parameter | Description |
---|---|
number | Required. amount of months the month field should increase. |
If omitted, the months are incremented by "1"
No return value
The following code shows how to Increment the value of a month field by 3 months:
<!DOCTYPE html> <html> <body> Month and year: <input type="month" id="myMonth" value="1997-11"> <button onclick="myFunction()">Test</button> <script> function myFunction() {// ww w .j av a 2s.co m document.getElementById("myMonth").stepUp(3); } </script> </body> </html>