Fieldset disabled property

HTML DOM Fieldset disabled property Fieldset object

Disable fieldset:

document.getElementById("myFieldset").disabled=true;

Output:

Personalia: Username:
Email:
date of birth:

Try it out . . .

Definitions and usages

The disabled property sets or returns whether to disable a set of related form elements (a fieldet).

If the property is set, the form property in fieldset is disabled.

Disabled elements are not available and cannot be clicked. By default, disabled elements are usually grayed out in the browser.

This property reflects the HTML disabled property.


Browser support

HTML DOM Fieldset disabled property HTML DOM Fieldset disabled property HTML DOM Fieldset disabled property HTML DOM Fieldset disabled property HTML DOM Fieldset disabled property

In addition to Internet Explorer and Safari, other major browsers support the disabled property.


Grammar

Returns the disabled property:

fieldsetObject .disabled

Set the disabled property:

fieldsetObject .disabled=true|false

The property value

value describe
true|false Specifies whether a set of related form elements (a Fieldset) is disabled.
  • True - Disabling FieldSet.
  • False - default.No Fieldset.

Technical details

Return value: Boolean value, if fieldset is disabled, returns true, otherwise false is returned.


More instances

Detect if a fieldet is disabled:

var x = document.getElementById("myFieldset").disabled;

x The output is:

true

Try it out . . .

Disable and de-disable fieldset:

function disableField()
{
document.getElementById("myFieldset").disabled=true;
}
function undisableFieldset()
{
document.getElementById("myFieldset").disabled=false;
}

Try it out . . .


Related articles

HTML Reference Manual: HTML slt;fieldset-disabled properties


HTML DOM Fieldset disabled property Fieldset object