CA Resources

Fieldset and Legend

The fieldset groups related form elements, while the legend provides a caption for the group.

The <fieldset></fieldset> element is used to group related data in a form.

The <legend></legend> elements defines a caption for <fieldset> element.

<form>
  <fieldset>
    <legend>Personal Information</legend>
    <label for="fname">First Name:</label>
    <input type="text" name="fname" id="fname"> <br />
    <label for="lname">Last Name:</label>
    <input type="text" name="lname" id="lname"> <br />
    <input type="submit" name="btnsave" value="Save">
  </fieldset>
</form>

On this page

No Headings
Edit on GitHub