Input DatetimeLocal step Property - Change the legal number intervals for milliseconds in a local date field: - Javascript DOM HTML Element

Javascript examples for DOM HTML Element:Input Datetime Local

Description

Input DatetimeLocal step Property - Change the legal number intervals for milliseconds in a local date field:

Demo Code

ResultView the demo in separate window

<!DOCTYPE html>
<html>
<body>
Date: <input type="datetime-local" id="myLocalDate" step=".1">

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

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

<script>
function myFunction() {// w w  w  . j ava 2  s . c  om
    document.getElementById("myLocalDate").step = ".020";
    document.getElementById("demo").innerHTML = "The value of the step attribute was changed from '.1' to '.050'.";
}
</script>
</body>
</html>

Related Tutorials