Javascript examples for DOM HTML Element:Input Datetime Local
Input DatetimeLocal max Property - Change the maximum date and time:
<!DOCTYPE html> <html> <body> Date and time://from ww w.ja v a2s.c o m <input type="datetime-local" id="myLocalDate" min="2000-10-06T22:22:55" max="2018-11-16T21:25:33"> <button onclick="myFunction()">Test</button> <p id="demo"></p> <script> function myFunction() { var x = document.getElementById("myLocalDate").max = "2012-01-01T22:22:55"; document.getElementById("demo").innerHTML = "changed from '2018-11-16T21:25:33' to '2012-01-01T22:22:55'."; } </script> </body> </html>