当前位置: 代码迷 >> Java Web开发 >> 简单的单选按钮解决方案
  详细解决方案

简单的单选按钮解决方案

热度:1299   发布时间:2013-02-25 21:12:18.0
简单的单选按钮
我有2个单选按钮A和B,A是默认选中的,当我选中B时,A也是选中的,有什么办法选中B时,A不是选中的。
HTML code
<form><input type="radio" value="boy"  checked="checked"/>boy <input type="radio" value="gril" />gril</form>


------解决方案--------------------------------------------------------
没有设置 name,必须保持一致,类似:

<form>
<input name="sex" type="radio" value="boy" checked="checked"/>boy 
<input name="sex" type="radio" value="gril" />gril
</form>
  相关解决方案