解决方法
见
W3C specs:
for for label
,并指定标签应用于的输入元素的id属性.
另见HTML5 specs:
The
div
element has no special meaning at all. It represents its children. It can be used with theclass
,lang
,andtitle
attributes to mark up semantics common to a group of consecutive elements.Note: Authors are strongly encouraged to view the
div
element as an element of last resort,for when no other element is suitable. Use of more appropriate elements instead of thediv
element leads to better accessibility for readers and easier maintainability for authors.