Skip to content

<fieldset> - The Fieldset Element

Form Control HTML 4.0

The fieldset element groups related form controls together, creating a logical and visual container. It’s especially important for accessibility, helping screen readers understand the relationship between form fields.

Result
<fieldset>
<legend>Group Title</legend>
<!-- Form controls go here -->
</fieldset>

A fieldset typically contains a <legend> element as its first child, which provides a caption for the group.

AttributeDescriptionExample
disabledDisables all controls in the fieldsetdisabled
formAssociates with a form by IDform="myForm"
nameName of the fieldsetname="shipping"
Result
Result
Result
Result
Result
Result
Result
Result
Result
Result
Result
Result
<fieldset>
<legend>Shipping Method</legend>
<label>
<input type="radio" name="shipping" value="standard">
Standard
</label>
<label>
<input type="radio" name="shipping" value="express">
Express
</label>
</fieldset>
Result
Result

Fieldsets improve keyboard navigation by:

  • Grouping related controls logically
  • Allowing screen readers to skip entire groups
  • Providing context when navigating between fields
<fieldset>
<legend>Payment Method</legend>
<!-- Payment options -->
</fieldset>
<fieldset>
<legend>Billing Address</legend>
<!-- Address fields -->
</fieldset>

Not every group of inputs needs a fieldset:

<form>
<label for="name">Name:</label>
<input type="text" id="name" name="name">
<label for="email">Email:</label>
<input type="email" id="email" name="email">
<button type="submit">Submit</button>
</form>
<fieldset>
<legend>T-Shirt Size</legend>
<label><input type="radio" name="size" value="s">Small</label>
<label><input type="radio" name="size" value="m">Medium</label>
<label><input type="radio" name="size" value="l">Large</label>
</fieldset>
BrowserVersionNotes
Chrome1+Full support
Firefox1+Full support
Safari1+Full support
Edge12+Full support
IE4+Full support

The <fieldset> element has been supported since early browser versions.