Javascript examples for DOM HTML Element:Input Datetime
Input Datetime disabled Property - Disable and enable a datetime field:
<!DOCTYPE html> <html> <body> <input type="datetime" id="myDatetime"><br><br> <button onclick="disableBtn()">Disable Datetime Field</button> <button onclick="enableBtn()">Enable Datetime Field</button> <script> function disableBtn() {//w w w.ja v a 2 s . com document.getElementById("myDatetime").disabled = true; } function enableBtn() { document.getElementById("myDatetime").disabled = false; } </script> </body> </html>