Javascript DOM HTML Input Month stepDown() Method without parameter

Introduction

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.

View in separate window

<!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>



PreviousNext

Related