Edit This Code:
<!DOCTYPE html>
<html>
<body>

<input type="month" id="myMonth"><br><br>

<button onclick="disableBtn()">Disable Month Field</button>
<button onclick="undisableBtn()">Undisable Month Field</button>

<p><strong>Note:</strong> input elements with type="month" are not supported in Internet Explorer or Firefox.</p>

<script>
function disableBtn() {
    document.getElementById("myMonth").disabled = true;
}
function undisableBtn() {
    document.getElementById("myMonth").disabled = false;
}
</script>

</body>
</html>


Result:
Try it Yourself - © w3schools.com
Privacy Policy