Skip to content
Astera Technology

Understand the first-legend exception in a disabled fieldset

Compare an input’s own disabled property with its effective disabled state inherited from fieldset.

The first legend checkbox remains enabled; the outside text field is effectively disabled.

Download complete case notes and answer keys ↓

Inspect the working example

The fieldset is disabled. Its first legend contains a checkbox, while a text field sits outside that legend. The checkbox is an isolated native example: toggling it does not enable the text field or perform another action.

Inputs and native observations
CaseInput or inspectionResult and meaning
Legend descendantInspect legend-check :enabledTrue; it can be toggled
Outside controlInspect note :disabledTrue; fieldset disabled state applies
Own propertyRead note.disabledFalse, because the input itself lacks the disabled attribute
Download editable CSV ↓

Follow the browser mechanism

A disabled fieldset disables relevant descendants except those inside its first legend. An input’s disabled property reflects its own attribute; :disabled tests effective disabled state, including this inheritance. Do not infer editability from the property alone.

A second legend does not get the first-legend exception

The counterexample keeps a first legend and puts the checkbox in a second legend. Only the first legend descendant exception is defined for the disabled fieldset.

Counterexample source; inspect separately
<fieldset disabled><legend>First legend</legend><legend><label><input id="legend-check" type="checkbox">Second legend checkbox</label></legend><label>Sample note <input id="note" value="Fixed sample"></label></fieldset>

The checkbox now matches :disabled and cannot be toggled by the user. This malformed extra-legend example illustrates the first-legend boundary; use one legend in the actual fieldset.

Try the repair

The text input has disabled=false in its own property. Is that sufficient evidence that a user can edit it here?

Show the worked answer

No. Its containing fieldset is disabled and the input is outside the first legend. Check :disabled and the actual interaction; the effective state is disabled.

  • Record own attribute/property and effective selector state separately.
  • Toggling the legend checkbox must leave the disabled text field disabled.

Original example files

Related resources