Using quot;label forquot; on radio buttons(使用“标签为在单选按钮上)
问题描述
在单选按钮上使用label for"参数时,要508 兼容*,下面的说法正确吗?
When using the "label for" parameter on radio buttons, to be 508 compliant*, is the following correct?
<label for="button one"><input type="radio" name="group1" id="r1" value="1" /> button one</label>
还是这个?
<input type="radio" name="group1" id="r1" value="1" /><label for="button one"> button one</label>
我问的原因是,在第二个示例中,标签"仅包含文本,而不包含实际的单选按钮.
Reason I ask is that in the second example, "label" is only encompassing the text and not the actual radio button.
*1973 年《康复法案》第 508 条要求联邦机构向残障人士提供软件和网站可访问性.
*Section 508 of the Rehabilitation Act of 1973 requires federal agencies to provide software and website accessibility to people with disabilities.
推荐答案
你几乎明白了.应该是这样的:
You almost got it. It should be this:
<input type="radio" name="group1" id="r1" value="1" />
<label for="r1"> button one</label>
for 中的值应该是您要标记的元素的 id.
The value in for should be the id of the element you are labeling.
这篇关于使用“标签为"在单选按钮上的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:使用“标签为"在单选按钮上
基础教程推荐
- fetch 是否支持原生多文件上传? 2022-01-01
- 原生拖动事件后如何获取 mouseup 事件? 2022-01-01
- 即使用户允许,Gmail 也会隐藏外部电子邮件图片 2022-01-01
- 在 contenteditable 中精确拖放 2022-01-01
- 如何添加到目前为止的天数? 2022-01-01
- Fabric JS绘制具有活动形状的多边形 2022-01-01
- Bokeh Div文本对齐 2022-01-01
- npm start 错误与 create-react-app 2022-01-01
- 检查 HTML5 拖放文件类型 2022-01-01
- Bootstrap 模态出现在背景下 2022-01-01
