Fieldset disabled property
Example
Disable the fieldset:
document.getElementById("myFieldset").disabled=true;
Output result:
Try it »
Definition and Usage
The disabled property sets or returns whether a group of related form elements (a fieldset) is disabled.
If this property is set, the form elements within the fieldset are disabled.
Disabled elements are unavailable and cannot be clicked. By default, disabled elements are usually rendered in gray in the browser.
This attribute reflects the HTML disabled attribute.
Browser support





Except for Internet Explorer and Safari, all other major browsers support the disabled property.
Syntax
Return the disabled attribute:
fieldsetObject
.disabled
Set the disabled attribute:
fieldsetObject
.disabled=true|false
Attribute values
| Value | Description |
|---|---|
| true|false | Specifies whether a group of related form elements (a fieldset) is disabled.
|
Technical Details
| Return Value: | Boolean, returns true if the fieldset is disabled, otherwise returns false. |
|---|
More examples
Example
Check whether a fieldset is disabled:
var x = document.getElementById("myFieldset").disabled;
x The output is:
true
Try it »
Example
Disable and re-enable the fieldset:
function disableField()
{
document.getElementById("myFieldset").disabled=true;
}
function undisableFieldset()
{
document.getElementById("myFieldset").disabled=false;
}
Try it »
Related Articles
HTML Reference Manual:HTML
Fieldset Object