首页 > 其他 > 详细

form中 单选框 input[type="radio"] 分组

时间:2017-11-09 10:32:14      阅读:247      评论:0      收藏:0      [点我收藏+]
在form中有时候需要给单选框分组,这种情况下 可以通过给单选框设置相同的name来进行分组;

  1. <html>  
  2.     <head>  
  3.        <title> </title>         
  4.     </head>  
  5.     <meta charset="utf-8">  
  6.     <body>  
  7.         <form action="" method="">  
  8.           <!--通过name将他们分组-->  
  9.         <input type="radio" name="sex"/>男  
  10.         <input type="radio" name="sex"/>女  
  11.   
  12.         <input type="radio" name="subject"/>HTML  
  13.         <input type="radio" name="subject"/>CSS  
  14.         
  15.         </form>  
  16.   
  17.     </body>  
  18. </html>  






form中 单选框 input[type="radio"] 分组

原文:http://www.cnblogs.com/DreamSeeker/p/7807873.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!