问题描述
大量(我敢说最多吗?)网站没有使标签可点击以用于其复选框和单选输入.这似乎是一个巨大的可用性增益,只需很少的努力.使用 是否存在任何兼容性/功能性/可用性问题会阻碍开发人员使用此标签?
A large number of (dare I say most?) sites do not make the labels clickable for their checkbox and radio inputs. It seems to be a huge usability gain for very little effort. Are there any compatibility/functionality/usability issues with using <label>
that would discourage developers from using this tag?
甚至 Stack Overflow 似乎也犯了这个错误,例如,在提出问题时,每天通知任何新答案复选框标签是不可点击的.
Even Stack Overflow seems guilty of this, e.g., when asking a question, the Notify daily of any new answers checkbox label is not clickable.
推荐答案
除了懒惰没有其他原因.s 对于可访问性来说是必不可少的,对于我们这些鼠标点击目标不明确的人来说也非常方便:)
No reason other than laziness. <label>
s are essential for accessibility, and are also pretty handy for those of us who have poor aim with our mouse clicks :)
这篇关于使复选框和单选标签可点击的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!