Our site has two primary navigation links to two completely different pages. Something like this:
<section>
<header>
<nav>
<ul>
<li><a href="link1.html">Link 1</a></li>
<li><a href="link2.html">Link 2</a></li>
</ul>
</nav>
</header>
</section>
On one of the pages, we also have a filtering component made up of a list of links that uses Ajax to change the result set listed in the main content area (similar to how kayak.com filters their flight options in real time as you adjust sliders, click checkboxes, etc.)
My question is, should that group of filtering links be wrapped in a <nav>
element?
It would look like this:
<section>
<nav>
<ul>
<li><a href="#filter1">Filter 1</a></li>
<li><a href="#filter2">Filter 2</a></li>
<li><a href="#filter3">Filter 3</a></li>
<li><a href="#filter4">Filter 4</a></li>
<li><a href="#filter5">Filter 5</a></li>
</ul>
</nav>
</section>
The reason for my confusion is that the spec is not clear as to whether materially changing the content of the page via a method such as filtering constitutes "primary navigation". Also, I'm not sure if having two nav elements on the page like this would be semantically confusing from an accessibility standpoint.
The <nav> HTML element represents a section of a page whose purpose is to provide navigation links, either within the current document or to other documents. Common examples of navigation sections are menus, tables of contents, and indexes.
The objective of this technique is to group navigation links using the HTML5 nav element. The nav element is one of several sectioning elements in HTML5. Use of this markup can make groups of links easier to locate and skip past by users of assistive technology such as screen readers.
The <nav> tag defines a set of navigation links.
Nav can be used multiple times on a page in HTML5.
You could, but it's not semantically correct. I'd go for a command tag here, because you're not navigating the content, you're giving the command to show/hide certain content based on some criteria.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With