Javascript examples for DOM HTML Element:Input Time
The Input Time object represents an HTML <input> element with type="time".
You can access an <input> element with type="time" by using getElementById():
<!DOCTYPE html> <html> <body> <input type="time" id="myTime" value="22:15:00"> <button onclick="myFunction()">get the time of the time field</button> <p id="demo"></p> <script> function myFunction() {/* w w w .j a va 2 s.c o m*/ var x = document.getElementById("myTime").value; document.getElementById("demo").innerHTML = x; } </script> </body> </html>