Fieldset disabledProperty
Examples
Disable the fieldset:
document.getElementById("myFieldset").disabled=true;
Output:
Try it Yourself »
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 inside the fieldset are disabled.
Disabled elements are unusable and un-clickable. By default, disabled elements are usually rendered in gray in browsers.
This property reflects the HTML disabled attribute.
Browser Support
![]()
![]()
![]()
![]()
![]()
All mainstream browsers support the disabled attribute, except Internet Explorer and Safari.
Syntax
Return the disabled property:
fieldsetObject.disabled
Set the disabled property:
fieldsetObject.disabled=true|false
Property Values
| Value | Description |
|---|---|
| true|false | Specifies whether a group of related form elements (a fieldset) is disabled.
|
Technical Details
| Return Value: | A Boolean value, returns true if the fieldset is disabled, otherwise returns false. |
|---|
More Examples
Example
Check if a fieldset is disabled:
var x = document.getElementById("myFieldset").disabled;
xOutput:
true
Try it Yourself »
Example
Disable and un-disable a fieldset:
function disableField()
{
document.getElementById("myFieldset").disabled=true;
}
function undisableFieldset()
{
document.getElementById("myFieldset").disabled=false;
}
{
document.getElementById("myFieldset").disabled=true;
}
function undisableFieldset()
{
document.getElementById("myFieldset").disabled=false;
}
Try it Yourself »
Related Articles
HTML Reference:HTML <fieldset> disabled Attribute
Other Extensions
Fieldset Object