Explain the purpose of the ‘fieldset’ and ‘legend’ elements.

<fieldset> groups related form elements, and <legend> provides a caption for the fieldset, improving accessibility and form organization.

Example:

<fieldset>
  <legend>Personal Information</legend>
  <label>Name: <input type="text"></label>
</fieldset>