1

Hope you are doing well, i saw many of peoples are using role attribute in html5 elements so, My question is that how much importance is it for us. We should be use it in our coding or not? or it's up to us use or not?

Example:

<header role="main_header"></header>
<section role="main_section" class="section">
<article role="mian_article">
<section role="main_section" class="inner_section"></section>
</article>
</section>

What is the advantages of it?

Protomen
  • 9,471
  • 9
  • 57
  • 124
  • 2
    check this out http://stackoverflow.com/questions/10403138/what-is-the-purpose-of-the-role-attribute-in-html?rq=1 – Afsar Jan 13 '15 at 11:59

2 Answers2

0

Use cases for a role attribute for HTML5, include:

  • accessibility.
  • device adaptation.
  • server-side processing.
  • complex data description.

Source : http://www.w3.org/wiki/PF/XTech/HTML5/RoleAttribute

nasserui
  • 86
  • 4
0

Role is used for giving information about element and others uses too. For more information you can visit

What is the purpose of the "role" attribute in html?

Community
  • 1
  • 1
Swapnil Motewar
  • 1,080
  • 6
  • 12