Fieldset and Legend Elements
<fieldset> <legend> … </fieldset>
Section titled “<fieldset> <legend> … </fieldset>”<form action="/preferences" method="post" name="preferencesForm"> <fieldset> <legend>Contact Preferences</legend> <label> <input type="checkbox" name="contact" value="email" /> Email </label> <label> <input type="checkbox" name="contact" value="phone" /> Phone Call </label> </fieldset>
<input type="submit" value="Save Preferences" /></form>fieldset
Section titled “fieldset”The fieldset element provides a grouping mechanism for a set of inputs as well as their labels.
Aside from providing a container for CSS styling, fieldsets allow disabling groups of inputs at once.
legend
Section titled “legend”The legend element provides a caption for its parent fieldset.