Question · HTML and CSS course · Module 10: Accessibility (a11y)

The Role of fieldset and legend

When should you use <fieldset> and <legend> elements in forms?

Answer options

  • They are deprecated and should not be used
  • Only for styling form borders
  • Only in login forms
  • To group related fields, especially radio buttons and checkboxes

You can check the correct answer by solving this task in the CodeWorlds game.