Input Week disabled Property - Disable and enable a week field: - Javascript DOM HTML Element

Javascript examples for DOM HTML Element:Input Week

Description

Input Week disabled Property - Disable and enable a week field:

Demo Code

ResultView the demo in separate window

<!DOCTYPE html>
<html>
<body>

<input type="week" id="myWeek"><br><br>

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

<script>
function disableBtn() {/*from  w w w  .  jav  a 2 s .  c om*/
    document.getElementById("myWeek").disabled = true;
}

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

</body>
</html>

Related Tutorials