Input Month min Property - Change the minimum value: - Javascript DOM HTML Element

Javascript examples for DOM HTML Element:Input Month

Description

Input Month min Property - Change the minimum value:

Demo Code

ResultView the demo in separate window

<!DOCTYPE html>
<html>
<body>
Month:/*from   w  ww.  j  a va 2 s.  com*/
<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").min= "2018-01";
    document.getElementById("demo").innerHTML = "changed";
}
</script>
</body>
</html>

Related Tutorials