Latest web development tutorials

HTML DOM Fieldset disabled property

Fieldset Object Reference Fieldset objects

Examples

Disable fieldset:

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

Output:

Personalia: 用户名:
Email:
出生日期:

try it"

Definition and Usage

disabled property sets or returns whether to disable a group of related form elements (a fieldset).

If this attribute is set, fieldset in the form properties are disabled.

Disabled elements are not available, and do not click. By default, the disabled elements typically exhibit gray in your browser.

This property reflects the HTML disabled property.


Browser Support

Internet ExplorerFirefoxOperaGoogle ChromeSafari

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


grammar

Returns disabled properties:

fieldsetObject .disabled

Set the disabled attribute:

fieldsetObject .disabled=true|false

Property Value

描述
true|false 指定是否禁用一组相关的表单元素(一个 fieldset)。
  • true - 禁用 fieldset。
  • false - 默认。不禁用 fieldset。

technical details

return value: Boolean value that, if you disable fieldset returns true, otherwise returns false.


More examples

Examples

Detecting whether a fieldset is disabled:

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

x The output is:

true

try it"

Examples

Disabling and Enabling a fieldset:

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

try it"


related articles

HTML Reference Manual: HTML <fieldset> Disabled Property


Fieldset Object Reference Fieldset objects