Javascript examples for DOM HTML Element:Input Datetime
Input Datetime value Property - Get the date and time of a datetime field:
<!DOCTYPE html> <html> <body> Date: <input type="datetime" id="myDatetime" value="2018-02-06T10:57Z"> <button onclick="myFunction()">Test</button> <p id="demo"></p> <script> function myFunction() {//from www . j av a2 s . com var x = document.getElementById("myDatetime").value; document.getElementById("demo").innerHTML = x; } </script> </body> </html>