一、label和input合作的两种形式
来自 W3C
The label element represents a caption in a user interface. The caption can be associated with a specific form control, known as the label element’s labeled control, either using the for attribute, or by putting the form control inside the label element itself.
在用户交互界面的时候,label元素作为一个标题说明。这个说明可以与特定的form control关联,熟知的形式有两种:①通过for属性关联;②通过将form contorl放到label标签里面;
W3C WIKI上给出了两种的例子 : https://www.w3.org/wiki/HTML/Elements/label
但是第二种在由于是label nested input,如果将事件绑在label上,会触发内层input的click事件。
二、label响应两次
可以点击示例 http://codepen.io/GitKou/pen/aZBWLr
<label for="innerIpt1">
<input id="innerI