<html>
<body>
<input type="month" id="myMonth"><br><br>
<button onclick="disableBtn()">禁用 Month 字段</button>
<button onclick="undisableBtn()">启用 Month 字段</button>
<script>
function disableBtn() {
document.getElementById("myMonth").disabled = true;
}
function undisableBtn() {
document.getElementById("myMonth").disabled = false;
}
</script>
</body>
</html>