Skip to content

Commit

Permalink
New pages: html*element.disabled (#35966)
Browse files Browse the repository at this point in the history
  • Loading branch information
estelle committed Sep 20, 2024
1 parent 8cc49c5 commit c32a37e
Show file tree
Hide file tree
Showing 2 changed files with 76 additions and 0 deletions.
38 changes: 38 additions & 0 deletions files/en-us/web/api/htmlfieldsetelement/disabled/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
---
title: "HTMLFieldSetElement: disabled property"
short-title: disabled
slug: Web/API/HTMLFieldSetElement/disabled
page-type: web-api-instance-property
browser-compat: api.HTMLFieldSetElement.disabled
---

{{ APIRef("HTML DOM") }}

The **`disabled`** property of the {{domxref("HTMLFieldSetElement")}} interface is a boolean value that reflects the {{htmlelement("fieldset")}} element's [`disabled`](/en-US/docs/Web/HTML/Element/fieldset#disabled) attribute, which indicates whether the control is disabled.

When disabled, all the form control descendants of the `<fieldset>` element, excluding elements that are descendants of the {{htmlelement("legend")}} child of the `<fieldset>`, if any, are disabled. A disabled element is unusable and un-clickable, and match the {{cssxref(":disabled")}} selector, even if their `disabled` property value is false.

## Value

A boolean value.

## Examples

```js
const fs = document.getElementById("billing-address");
console.log(fs.disabled);
fs.disabled = true;
```

## Specifications

{{Specifications}}

## Browser compatibility

{{Compat}}

## See also

- HTML [`disabled`](/en-US/docs/Web/HTML/Attributes/disabled) attribute
- CSS {{cssxref(":disabled")}} and {{cssxref(":enabled")}} pseudoclasses
38 changes: 38 additions & 0 deletions files/en-us/web/api/htmloptgroupelement/disabled/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
---
title: "HTMLOptGroupElement: disabled property"
short-title: disabled
slug: Web/API/HTMLOptGroupElement/disabled
page-type: web-api-instance-property
browser-compat: api.HTMLOptGroupElement.disabled
---

{{ APIRef("HTML DOM") }}

The **`disabled`** property of the {{domxref("HTMLOptGroupElement")}} interface is a boolean value that reflects the {{htmlelement("optgroup")}} element's [`disabled`](/en-US/docs/Web/HTML/Element/optgroup#disabled) attribute, which indicates whether the control is disabled.

When disabled, the {{htmlelement("option")}} element descendants of the `<optgroup>` element are unusable, un-clickable, and unselectable. These disabled `<option>`s will match the {{cssxref(":disabled")}} selector, even if their `disabled` property value is false.

## Value

A boolean value.

## Examples

```js
const optionGroup = document.getElementById("groupB");
console.log(optionGroup.disabled);
optionGroup.disabled = true;
```

## Specifications

{{Specifications}}

## Browser compatibility

{{Compat}}

## See also

- HTML [`disabled`](/en-US/docs/Web/HTML/Attributes/disabled) attribute
- CSS {{cssxref(":disabled")}} and {{cssxref(":enabled")}} pseudoclasses

0 comments on commit c32a37e

Please sign in to comment.