Home  /  Questions  /  Question



340   99.9
Aug 10, 2013


What is the purpose of the Role attribute in HTML?

Lately I have seen several instances where a role attribute is included in the HTML. 
These are some examples: 

<header class="navbar navbar-fixed-top" role="banner">
</header>
and 

<ul class="dropdown-menu" role="menu">
  <li><a href="/">Home</a></li>
  <li><a href="/products">Products</a></li>
  <li><a href="/services">Services</a></li>
</ul>

Is this a valid HTML construct?  
If so, what is it used for?  From the examples it seems to have a semantic meaning. 

Thanks.