Edit This Code:
<!DOCTYPE html>
<html>
<body>

Checkbox: <input type="checkbox" id="myCheck">

<button onclick="disable()">Disable checkbox</button>
<button onclick="undisable()">Undisable checkbox</button>

<script>
function disable() {
    document.getElementById("myCheck").disabled = true;
}

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

</body>
</html>


Result:
Try it Yourself - © w3schools.com
Privacy Policy