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.
这篇关于使用“标签为"在单选按钮上的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:使用“标签为"在单选按钮上


- addEventListener 在 IE 11 中不起作用 2022-01-01
- Flexslider 箭头未正确显示 2022-01-01
- 如何使用 JSON 格式的 jQuery AJAX 从 .cfm 页面输出查 2022-01-01
- Quasar 2+Apollo:错误:找不到ID为默认的Apollo客户端。如果您在组件设置之外,请使用ProvideApolloClient() 2022-01-01
- Css:将嵌套元素定位在父元素边界之外一点 2022-09-07
- 使用RSelum从网站(报纸档案)中抓取多个网页 2022-09-06
- 失败的 Canvas 360 jquery 插件 2022-01-01
- 400或500级别的HTTP响应 2022-01-01
- CSS媒体查询(最大高度)不起作用,但为什么? 2022-01-01
- Fetch API 如何获取响应体? 2022-01-01