Input Time step Property - Change the legal number intervals for milliseconds in a time field: - Javascript DOM HTML Element

Javascript examples for DOM HTML Element:Input Time

Description

Input Time step Property - Change the legal number intervals for milliseconds in a time field:

Demo Code

ResultView the demo in separate window

<!DOCTYPE html>
<html>
<body>
Time: <input type="time" id="myTime" step=".1">

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

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

<script>
function myFunction() {/*from ww w .ja  v  a2  s . co m*/
    document.getElementById("myTime").step = ".050";
    document.getElementById("demo").innerHTML = "The value of the step attribute was changed from '.1' to '.050'.";
}
</script>

</body>
</html>

Related Tutorials