Demo: Enable and Disable a Checkbox

Use the buttons to change the checkbox’s disabled property.

Checkbox is enabled.

JavaScript Top ↑

const checkbox = document.getElementById("ck1");
document.getElementById("disableButton").addEventListener("click", () => {
  checkbox.disabled = true;
});
document.getElementById("enableButton").addEventListener("click", () => {
  checkbox.disabled = false;
});
Enable and disable a checkbox with JavaScript

Enable/disable checkbox tutorial




Subscribe to our YouTube Channel here



plus2net.com










✖
We use cookies to improve your browsing experience. . Learn more
HTML MySQL PHP JavaScript ASP Photoshop Articles Contact us
© 2000-2026 plus2net.com All rights reserved worldwide Privacy Policy Disclaimer