Skip to main content

html-tags.com

<fieldset>

Groups related controls, with legend as the group's caption.

Baseline: Widely available · Forms

When to use it

Mandatory for radio and checkbox groups — the legend is announced with each control's label; disabled on it disables the whole group.

When not to

Don't use it as a generic bordered box; it announces itself as a group.

Key attributes

disabled
disables all contained controls
name / form

Example

Preferred edition
<fieldset>
  <legend>Preferred edition</legend>
  <input type='radio' id='ed-text' name='edition' checked>
  <label for='ed-text'>Plain text</label>
  <input type='radio' id='ed-html' name='edition'>
  <label for='ed-html'>Semantic HTML</label>
</fieldset>
Rendered live above, source below.

Authoritative references