Disable and enable a checkbox:
<!DOCTYPE html> <html> <body> Checkbox: <input type="checkbox" id="myCheck"> <button onclick="disable()">Disable checkbox</button> <button onclick="enable()">enable checkbox</button> <script> function disable() {/*from ww w . j av a 2 s. c o m*/ document.getElementById("myCheck").disabled = true; } function enable() { document.getElementById("myCheck").disabled = false; } </script> </body> </html>