Input Time max Property - Change the maximum time allowed: - Javascript DOM HTML Element

Javascript examples for DOM HTML Element:Input Time

Description

Input Time max Property - Change the maximum time allowed:

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 www. ja  v a 2  s  .c o m
    var x = document.getElementById("myTime").max = "23:00";
    document.getElementById("demo").innerHTML = "max attribute was changed from '22:00' to '23:00'.";
}
</script>

</body>
</html>

Related Tutorials