7

I have insert a menu in my index:

<nav id="mainmenu" class="navbar navbar-default" role="navigation">

But when I try to validate it (in local) the validator.w3 tell me:

Warning: Element nav does not need a role attribute.

I can't find a solution, can someone help me?

YvesLeBorg
  • 9,070
  • 8
  • 35
  • 48
RBNZ
  • 79
  • 1
  • 10
  • http://www.w3.org/WAI/GL/wiki/Using_HTML5_nav_element#Example%3aThe_.3Cnav.3E_element Note: When support for HTML5 improves there may be no need to continue to add the ARIA role="navigation". – Luca Aug 05 '15 at 12:02
  • Ok, so I don't need it.. Thanks YvesLeBorg – RBNZ Aug 05 '15 at 14:02
  • 1
    Does this not help for older browser support? I received the same error when checking validation. I removed it and saw no difference in terms of how the site performed...but i still wondering about older browsers. – debug Sep 07 '15 at 21:09

1 Answers1

9

Delete role="navigation".

The <nav> element already has the semantics of being for navigation. You don't need to add them with the role attribute. Saying "This navigation element is for navigation" is redundant and silly.

<nav id="mainmenu" class="navbar navbar-default">
Quentin
  • 914,110
  • 126
  • 1,211
  • 1,335