是否应将输入元素放在标签元素内? [英] Should I put input elements inside a label element?
本文介绍了是否应将输入元素放在标签元素内?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
是否有关于label
和input
HTML元素嵌套的最佳实践?
Is there a best practice concerning the nesting of label
and input
HTML elements?
经典方式:
<label for="myinput">My Text</label>
<input type="text" id="myinput" />
或
<label for="myinput">My Text
<input type="text" id="myinput" />
</label>
推荐答案
查看全文