Input Time min Property - Change the minimum value: - Javascript DOM HTML Element

Javascript examples for DOM HTML Element:Input Time

Description

Input Time min Property - Change the minimum value:

Demo Code

ResultView the demo in separate window

<!DOCTYPE html>
<html>
<body>
Time: <input type="time" id="myTime" min="20:00" max="22:00">

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

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

<script>
function myFunction() {//from   w w w  .  ja v a2  s .c om
    var x = document.getElementById("myTime").min = "16:00";
    document.getElementById("demo").innerHTML = "min attribute changed from '20:00' to '16:00'.";
}
</script>

</body>
</html>

Related Tutorials