html 的radio单选框如何实现互斥------radio只是input的type属性

  先看看没有互斥的情况:

  1 <html>
  2 <body>
  3 
  4 男性:<input type="radio" id="male" />
  5 <br />
  6 女性:<input type="radio" id="female" />
  7 <br />
  8 
  9 </body>
 10 </html>
 11 

  要实现互斥, 可以让名称一致, 比如:

  1 <html>
  2 <body>
  3 
  4 男性:<input type="radio" id="male"  name="xxx"/>
  5 <br />
  6 女性:<input type="radio" id="female" name="xxx"/>
  7 <br />
  8 
  9 </body>
 10 </html>
 11 

posted on 2018-11-17 11:40  sb_随便写写  阅读(1650)  评论(0)    收藏  举报

导航