Fieldset disabled attribute
Definition and usage
disabled
Property setting or returning whether a group of related form elements (fieldset) is disabled.
If this attribute is set, the form elements in the fieldset are disabled.
Disabled elements are not available and cannot be clicked. By default, disabled elements are usually displayed in gray in the browser.
This attribute reflects <fieldset> disabled attribute.
See also:
Manual de referencia de HTML:Etiqueta <fieldset> de HTML
Example
Example 1
Disable fieldset:
document.getElementById("myFieldset").disabled = true;
Example 2
Check if the fieldset is disabled:
var x = document.getElementById("myFieldset").disabled;
Example 3
Disable and enable fieldset:
function disableField() { document.getElementById("myFieldset").disabled = true; } function undisableFieldset() { document.getElementById("myFieldset").disabled = false; }
Syntax
Return disabled attribute:
fieldsetObject.disabled
Set disabled attribute:
fieldsetObject.disabled = true|false
Attribute value
Value | Description |
---|---|
true|false |
Specifies whether a group of related form elements (fieldset) should be disabled.
|
Technical details
Return value: | Boolean value, if the fieldset is disabled, it returns true, otherwise it returns false. |
---|
Compatibilidad del navegador
Chrome | Edge | Firefox | Safari | Opera |
---|---|---|---|---|
Chrome | Edge | Firefox | Safari | Opera |
Admite | 12.0 * | Admite | 6.1 | Admite |
* Las versiones 11 y anteriores de Internet Explorer admiten la propiedad disabled al regresar. Sin embargo, al establecer, el elemento se muestra como deshabilitado, pero el usuario aún puede interactuar con él.
Páginas relacionadas
Manual de referencia de HTML:Atributo disabled del campo <fieldset> de HTML