如何让用户只检查其中一个复选框..除了禁用选择复选框之外还有什么方法吗?
<td width="25%"><input type="checkbox" name="choice" value="Good" />Good</td>
<td width="25%"><input type="checkbox" name="choice" value="Average" />Average</td>
<td width="25%"><input type="checkbox" name="choice" value="Sucks" />Sucks</td>
<td width="25%"><input type="checkbox" name="choice" value="Fascinating" />Fascinating</td>
Run Code Online (Sandbox Code Playgroud)
如果它是一个JavaScript,请让它简单易懂..
您正在寻找一个单选按钮组.
<td width="25%"><input type="radio" name="choice" value="Good" />Good</td>
<td width="25%"><input type="radio" name="choice" value="Average" />Average</td>
<td width="25%"><input type="radio" name="choice" value="Sucks" />Sucks</td>
<td width="25%"><input type="radio" name="choice" value="Fascinating" />Fascinating</td>
Run Code Online (Sandbox Code Playgroud)