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

Javascript examples for DOM HTML Element:Input Month

Description

Input Month stepUp() Method - Increment 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  w w  w  .ja  v  a2 s. c om
    document.getElementById("myMonth").stepUp();
}
</script>

</body>
</html>

Related Tutorials