问题:
Is there a best practice concerning the nesting of label
and input
HTML elements? 是否存在关于嵌套label
和input
HTML元素的最佳实践?
classic way: 经典方式:
<label for="myinput">My Text</label>
<input type="text" id="myinput" />
or 要么
<label for="myinput">My Text
<input type="text" id="myinput" />
</label>
解决方案:
参考一: https://stackoom.com/question/3FMk/我应该将输入元素放在标签元素内吗参考二: https://oldbug.net/q/3FMk/Should-I-put-input-elements-inside-a-label-element
来源:oschina
链接:https://my.oschina.net/u/4428122/blog/4422317