[HTML5] Semantics for accessibility
html5 for
2023-09-14 08:59:17 时间
For example, when we use checkbox, if we do like this:
<div class="inline-control sign-up col-1"> <input type="checkbox" checked name="jLetter" id="jLetter"> Receive promotional offers? </div>
When we use screen reader, it will lose the semantics meaning, it only say:
checkbox checked
Instead, we want to hear:
Receive promotional offers?, checkbox, checked
There are two way to do it:
1. label wrap the checkbox
<div class="inline-control sign-up col-1"> <label> <input type="checkbox" checked name="jLetter"> Receive promotional offers? </label> </div>
2. Using id to match label and checkbox
<div class="inline-control sign-up col-1"> <div class="promotional"> <input type="checkbox" checked name="jLetter" id="jLetter"> <label for="jLetter">Receive promotional offers?</label> </div> </div>
相关文章
- HTML5中的DOM扩展(一)
- HTML5常用特性
- 干货|HTML5 项目如何转小程序运行
- 使用 HTML5 Shiv 让 IE 支持 HTML5
- 百度地图,高德地图,HTML5经纬度比较详解手机开发
- html5 web worker实现异步执行 计数器详解编程语言
- html5开发手机打电话发短信功能详解编程语言
- 高级HTML5 移动应用框架 Ionic v2.0.0-rc.5 发布详解编程语言
- html5自动弹出软键盘的方法详解编程语言
- html5不能播放视频的方法详解编程语言
- 利用HTML5和MySQL实现数据交换(html5连接mysql)
- 兼容性探究HTML5与Linux的兼容性(html5与linux)
- HTML5 教程
- HTML5 简介
- HTML5 表单元素
- Linux下如何优雅地使用For循环(linux下for循环)
- HTML5与Oracle结合,展现出更多可能(html5 oracle)
- 使用For语句操作Oracle数据库(for语句 oracle)