<html>
<body>
<form>
Cats:<input type="checkbox" id="cats"><br>
Dogs:<input type="checkbox" id="dogs">
</form>
<p>Click the button below to disable the first checkbox above.</p>
<button onclick="disableElement()">Disable checkbox</button>
<script>
function disableElement()
{
document.getElementById("cats").disabled=true;
}
</script>
</body>
</html>