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