CKTIS / JavaScript
HTMLButtonElement.disabled — disabling a button
HTMLButtonElement.disabled is a boolean property reflecting the presence of a button's disabled attribute. It lets you disable a button or remove its own disabled attribute, but does not describe every reason the control may be disabled.
Version: ECMAScript and Web APIs; exact feature edition and browser support reviewed per entry; Node 24 in repository does not prove browser API support
Syntax
button.disabled; button.disabled = true; button.disabled = false;HTMLButtonElement.disabled is a readable and writable boolean property on the button interface. It reflects the button's own disabled attribute: assigning true adds the attribute, while false removes it. This is a browser API defined by the HTML Standard, not a feature of ECMAScript itself; having Node 24 available does not establish support for this API.
A disabled button does not perform normal user activation, and its name–value pair is not submitted with the form. The attribute is boolean: its presence matters, not its textual value. Therefore, button.setAttribute('disabled', 'false') still disables the button; use button.disabled = false to remove the attribute.
The property value is not a complete test of effective disabledness. A button can have disabled === false yet remain disabled by an ancestor fieldset with the disabled attribute. Descendants of that fieldset element's first legend child are exempt from that ancestor's disabling effect. Setting button.disabled = false alone does not override disabling inherited from an ancestor.
Examples
const button = document.createElement('button');
button.type = 'button';
console.log(button.disabled);
button.disabled = true;
console.log(button.disabled, button.hasAttribute('disabled'));
button.disabled = false;
console.log(button.disabled, button.hasAttribute('disabled'));
button.setAttribute('disabled', 'false');
console.log(button.disabled);Result
false true true false false true
The displayed code and declared result were verified in an isolated environment using the method recorded in the verification evidence for this exact version.