Skip to main content
HTML Validation

Bad value “nav” for attribute “role” on element “nav”.

About This HTML Issue

nav is the name of an HTML element, not an ARIA role, so role="nav" on a <nav> element is an invalid value.

The role attribute accepts only role names defined in WAI-ARIA. The landmark role for a block of navigation links is navigation, spelled out in full, and shortened forms are not recognized. Browsers and assistive technologies ignore a role token they do not know and treat the element as if it had no role attribute.

The <nav> element already has the navigation role built in, so it needs no role attribute at all. Changing the value to role="navigation" clears this error, but the validator then warns that the role is unnecessary on nav. Remove the attribute instead. When a page has more than one <nav>, give each one an aria-label such as "Main" or "Footer" so screen reader users can tell the landmarks apart.

Invalid example

<nav role="nav">
  <ul>
    <li><a href="/">Home</a></li>
    <li><a href="/about">About</a></li>
  </ul>
</nav>

Valid example

<nav>
  <ul>
    <li><a href="/">Home</a></li>
    <li><a href="/about">About</a></li>
  </ul>
</nav>

Find issues like this automatically

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

Help us improve our guides

Was this guide helpful?
🌍 Trusted by teams worldwide

Validate at scale.
Ship accessible websites, faster.

Automated HTML & accessibility validation for large sites. Check thousands of pages against WCAG guidelines and W3C standards in minutes, not days.

Scheduled Reports
API Access
Open Source Standards
€5 / week

1K Weekly

1,000 monthly checks. Cancel anytime.

Get 1K Weekly →

Join teams across 40+ countries