What is importance of role attribute in html5?

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?


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


    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?

    链接地址: http://www.djcxy.com/p/36628.html

    上一篇: 需要了解一个css / php语句

    下一篇: 什么是HTML5中角色属性的重要性?