Skip to main content
HTML Validation

The “group” role is unnecessary for element “fieldset”.

About This HTML Issue

This W3C HTML Validator issue indicates that you have assigned a role="group" attribute to a <fieldset> element. In HTML, the <fieldset> element already has an implicit role of group so it’s redundant and unnecessary to explicitly specify it.

To resolve this issue, you simply need to remove the role="group" attribute from the <fieldset> element.

Example of the Issue

Here is an example of problematic HTML:

<form>
  <fieldset role="group">
      <legend>Personal Information</legend>
      <label for="name">Name:</label>
      <input type="text" id="name" name="name">
      <br>
      <label for="age">Age:</label>
      <input type="number" id="age" name="age">
  </fieldset>
</form>

Fixed HTML

To fix this issue, remove the role="group" attribute from the <fieldset> element:

<form>
  <fieldset>
      <legend>Personal Information</legend>
      <label for="name">Name:</label>
      <input type="text" id="name" name="name">
      <br>
      <label for="age">Age:</label>
      <input type="number" id="age" name="age">
  </fieldset>
</form>

Last reviewed: September 13, 2024

Was this guide helpful?

Find issues like this automatically

Rocket Validator scans thousands of pages in seconds, detecting HTML issues across your entire site.

Ready to validate your sites?
Start your free trial today.