码迷,mamicode.com
首页 > Web开发 > 详细

[HTML5] Why ARIA?

时间:2018-03-12 21:02:05      阅读:195      评论:0      收藏:0      [点我收藏+]

标签:nbsp   with   out   com   uil   ade   element   use   read   

For some reason, you build a custom checkbox component, if without ARIA in mind, basiclly this site is unusable for screen reader.

DEMO site.

In the example, screen reader only read the label of the checkbox, but doesn‘t tell it is a checkbox and the value of it.

<div tabindex="0" class="checkbox">
        Mint slices
      </div>

The way to fix it by tell the role is checkbox and set aria-checked to its value:

<div tabindex="0" class="checkbox" role="checkbox" aria-checked="true">
        Tim-Tams
      </div>

 

But really it we can use the native html element, just use the native element.

[HTML5] Why ARIA?

标签:nbsp   with   out   com   uil   ade   element   use   read   

原文地址:https://www.cnblogs.com/Answer1215/p/8550916.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!