Javascript examples for DOM HTML Element:Input Date
The Input object represents an HTML <input> element with type="date".
You can access an <input> element with type="date" by using getElementById():
<!DOCTYPE html> <html> <body> <input type="date" id="myDate" value="2014-02-09"> <button onclick="myFunction()">get the date of the date field</button> <p id="demo"></p> <script> function myFunction() {//from w ww .j av a2 s . c o m var x = document.getElementById("myDate").value; document.getElementById("demo").innerHTML = x; } </script> </body> </html>