<nav> or <menu> (HTML5)
W3Schools.com and I'm pretty sure I remember seeing W3C.org state that <menu>
should be used for Toolbar menus and listing form control commands.
So, which one should I use for my main menu? Nav
, or Menu
? Does it matter?
nav
is used for groups of internal links (a
elements). Generally this means the links should travel to separate pages, or change content in the case of an AJAX page. Expect some sort of content change when clicking on a nav
item.
menu
is used for groups of controls (a
, input
, button
). Generally this means the inputs should perform a function within the page. Expect some sort of javascript interaction when clicking on a menu
item.
nav
: the navigation for the site.
menu
: the menu for a web application.
Here's an HTML5Doctor post on nav
with a section on how it's different from menu
(basically, use it in actual apps). Looks like you want nav
.
With the <menu>
it's usually used for context menus.
MDN has good documentation on it: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/menu