首页 > Web开发 > 详细

[HTML5] Why ARIA?

时间:2018-03-12 20:25:48      阅读:282      评论:0      收藏:0      [点我收藏+]

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?

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

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!