Input Month max Property - Change the maximum month and year: - Javascript DOM HTML Element

Javascript examples for DOM HTML Element:Input Month

Description

Input Month max Property - Change the maximum month and year:

Demo Code

ResultView the demo in separate window

<!DOCTYPE html>
<html>
<body>
Month://  w  ww. j  a  v  a2 s  .c o  m
<input type="month" id="myMonth" min="2018-04" max="2018-09">

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

<p id="demo"></p>

<script>
function myFunction() {
    document.getElementById("myMonth").max = "2018-12";
    document.getElementById("demo").innerHTML = "changed";
}
</script>
</body>
</html>

Related Tutorials