fmpq.com
源代码:
点击运行
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>Fmpq教程(fmpq.com)</title> </head> <body> <input type="datetime-local" id="myLocalDate"><br><br> <button onclick="disableBtn()">禁用本地时间字段</button> <button onclick="undisableBtn()">启用本地时间字段</button> <script> function disableBtn() { document.getElementById("myLocalDate").disabled = true; } function undisableBtn() { document.getElementById("myLocalDate").disabled = false; } </script> </body> </html>
运行结果