1.html中怎么把單選按鈕規為一組?
設置他們的name屬性一個名字就可以了。
<input type="radio" name="aaa">男
<input type="radio" name="aaa">女
2.label標簽
2.1for關聯
<label for="email">E-mail:</label>
<input type="text" id="email">
label標簽就是他所關聯的表單控件的延伸,即鼠標點擊了他,就會出現和點擊他所關聯的表單控件一樣的效果。而這前提是label的for屬性的屬性值與想要關聯的表單控件的id一樣。
2.2若不想用id和for關聯還可用第二種方法。
<pre><pre name="code" class="html">
<label>E-mail:<input type="text"></label>
效果是和以前一樣的。
