Disable and enable a datetime field:
input elements with type="datetime" is supported by Safari.
<!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() {/* ww w. j a v a 2 s. c o m*/ document.getElementById("myDatetime").disabled = true; } function enableBtn() { document.getElementById("myDatetime").disabled = false; } </script> </body> </html>