Javascript examples for DOM HTML Element:Input Datetime Local
Input DatetimeLocal defaultValue Property - Get the default value of a datetime field:
<!DOCTYPE html> <html> <body> <input type="datetime-local" id="myLocalDate" value="2018-11-16T15:25:33"> <button onclick="myFunction()">Test</button> <p id="demo"></p> <script> function myFunction() {/*from w ww. java2 s.com*/ var x = document.getElementById("myLocalDate").defaultValue; document.getElementById("demo").innerHTML = x; } </script> </body> </html>