Get the value of a time field:
var x = document.getElementById("myTime").value;
Click the button to get the time of the time field.
<!DOCTYPE html> <html> <body> Time: <input type="time" id="myTime" value="21:43:54"> <button onclick="myFunction()">Test</button> <p id="demo"></p> <script> function myFunction() {//www. j av a 2 s . c o m var x = document.getElementById("myTime").value; document.getElementById("demo").innerHTML = x; } </script> </body> </html>