Decrement the value of a month field by 1 (default):
Click the button to decrement the value of the month field by 1 month.
The stepDown()
method is not supported by Firefox.
<!DOCTYPE html> <html> <body> Month and year: <input type="month" id="myMonth" value="2020-11"> <button onclick="myFunction()">Test</button> <script> function myFunction() {/*from w w w. ja v a 2 s . c o m*/ document.getElementById("myMonth").stepDown(); } </script> </body> </html>