Input Time disabled Property - Disable and enable a time field: - Javascript DOM HTML Element

Javascript examples for DOM HTML Element:Input Time

Description

Input Time disabled Property - Disable and enable a time field:

Demo Code

ResultView the demo in separate window

<!DOCTYPE html>
<html>
<body>

<input type="time" id="myTime"><br><br>

<button onclick="disableBtn()">Disable Time Field</button>
<button onclick="enableBtn()">Enable Time Field</button>

<script>
function disableBtn() {//from w  w  w  . j  a  v a2s  .  c  o  m
    document.getElementById("myTime").disabled = true;
}

function enableBtn() {
    document.getElementById("myTime").disabled = false;
}
</script>

</body>
</html>

Related Tutorials