Input Time defaultValue Property - Get the default value of a time field: - Javascript DOM HTML Element

Javascript examples for DOM HTML Element:Input Time

Description

Input Time defaultValue Property - Get the default value of a time field:

Demo Code

ResultView the demo in separate window

<!DOCTYPE html>
<html>
<body>
Time: <input type="time" id="myTime" value="16:32:55">

<button type="button" onclick="myFunction()">Test</button>

<p id="demo"></p>

<script>
function myFunction() {//  ww  w .  ja v  a2s  .  co  m
    var x = document.getElementById("myTime").defaultValue;
    document.getElementById("demo").innerHTML = x;
}
</script>

</body>
</html>

Related Tutorials