Input Datetime min Property - Change the minimum date and time: - Javascript DOM HTML Element

Javascript examples for DOM HTML Element:Input Datetime

Description

Input Datetime min Property - Change the minimum date and time:

Demo Code

ResultView the demo in separate window

<!DOCTYPE html>
<html>
<body>

Date and time:/*from   ww w . j ava2s  .com*/
<input type="datetime" id="myDatetime" min="2000-01-01T22:57Z" max="2018-02-06T22:57Z">

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

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

<script>
function myFunction() {
    var x = document.getElementById("myDatetime").min = "2010-01-01T21:57Z";
    document.getElementById("demo").innerHTML = "changed from '2000-01-01T22:57Z' to '2010-01-01T21:57Z'.";
}
</script>
</body>
</html>

Related Tutorials