Input Month stepDown() Method - Decrement the value of a month field by 1 (default): - Javascript DOM HTML Element

Javascript examples for DOM HTML Element:Input Month

Description

Input Month stepDown() Method - Decrement the value of a month field by 1 (default):

Demo Code

ResultView the demo in separate window

<!DOCTYPE html>
<html>
<body>

Month and year: <input type="month" id="myMonth" value="1997-11">

<button onclick="myFunction()">Test</button>

<script>
function myFunction() {/*from   ww w.j a va2 s .c o  m*/
    document.getElementById("myMonth").stepDown();
}
</script>

</body>
</html>

Related Tutorials