码迷,mamicode.com
首页 > Web开发 > 详细

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

时间:2018-11-17 13:11:43      阅读:230      评论:0      收藏:0      [点我收藏+]

标签:type   pre   span   radio   互斥   如何   body   html   color   

  先看看没有互斥的情况:

  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 

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

标签:type   pre   span   radio   互斥   如何   body   html   color   

原文地址:https://www.cnblogs.com/ago-0912/p/9973338.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!