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