這個為什么第二個能實現單選,第一個不行呢?
<form method="post" action="save.php">
<label>1.你喜歡的運動是:</label><br/>
<label for="run">跑步</label>
<input type="radio" name "1" value="a" id="run"/>
<label for="jump">跳遠</label>
<input type="radio" name="1" value="b" id="jump"/><br/>
<label>2.你喜歡的音樂類型是:</label><br/>
<label for="liuxing">流行</label>
<input type="radio" name="2" value="d" id="liuxing"/>
<label for="shanggan">傷感</label>
<input type="radio" name="2" value="c" id="shanggan"/><br/>
<input type="submit" value="提交" name="submitBtn"/>
<input type="reset" value="重置" name="resetBtn"/>
</form>
2016-10-16
<form method="post" action="save.php">
??? <label>1.你喜歡的運動是:</label><br/>
??? <label for="run">跑步</label>
??? <input type="radio" name= "1" value="a" id="run"/>
??? <label for="jump">跳遠</label>
??? <input type="radio" name="1" value="b" id="jump"/><br/>
??? <label>2.你喜歡的音樂類型是:</label><br/>
??? <label for="liuxing">流行</label>
??? <input type="radio" name="2" value="d" id="liuxing"/>
??? <label for="shanggan">傷感</label>
??? <input type="radio" name="2" value="c" id="shanggan"/><br/>
??? <input type="submit" value="提交" name="submitBtn"/>
??? <input type="reset" value="重置" name="resetBtn"/>
</form>
第四行的name沒有打"="看到沒
2016-10-16
<label for="run">跑步</label>
<input type="radio" name "1" value="a" id="run"/>
這里少了一個(=)號