While designing a form, you might like to group a few input fields into a group to help organise the form layout. This can be done by using the tag . Here is an example for using it.

For each fieldset, you can set a legend for the set using the tag LEGEND TEXT

Example

<form>
  <fieldset>
     <legend>1st field set:</legend>
     Field one:<br>
     <input type="text"><br>
     Field two:<br>
     <input type="text"><br>
  </fieldset><br>
  <fieldset>
     <legend>2nd field set:</legend>
     Field three:<br>
     <input type="text"><br>
     Field four:<br>
     <input type="text"><br>
  </fieldset><br>
  <input type="submit" value="Submit">
</form>

Result

https://s3-us-west-2.amazonaws.com/secure.notion-static.com/1bc01fc5-3b12-4815-866f-48d28755dbed/Untitled.png

Browser Support

Chrome, IE, Edge, FireFox, Safari and Opera’s latest versions also supports the tag