label 标签for属性
<h1>显式指定通过for(for的值就是对应radio的id的值)</h1> <form> <label for="male">Male</label> <input type="radio" name="sex" id="male" /> <br /> <label for="female">Female</label> <input type="radio" name="sex" id="female" /> </form> <h1>隐式指定只用label标签把radio包括进来</h1> <form> <label>Male<input type="radio" name="sex" id="male" /></label> <br /> <label>Female<input type="radio" name="sex" id="female" /></label> </form>
☜☞梦想总是要有的,万一实现了呢☜☞