Skip to main content
HTML Validation

The “list” role is unnecessary for element “ul”.

About This HTML Issue

Remove the role="list" attribute from the ul element.

The ul (unordered list) element is inherently recognized as a list in HTML. As such, it is automatically associated with the semantic role of a list. Adding role="list" to a ul is redundant and can also confuse browsers and screen readers, potentially leading to inconsistent behavior or impaired accessibility. This attribute is unnecessary because the list role is implicitly defined for this element through HTML specifications, and W3C HTML validation flags it to ensure semantic clarity and best practices.

Example of Incorrect role Usage:

<ul role="list">
  <li>Item 1</li>
  <li>Item 2</li>
  <li>Item 3</li>
</ul>

Corrected Example Without Unnecessary role:

<ul>
  <li>Item 1</li>
  <li>Item 2</li>
  <li>Item 3</li>
</ul>

By excluding the role="list", the code adheres to semantic clarity and best practices, complying with W3C standards while maintaining accessibility.

Last reviewed: April 04, 2025

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.