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

Bootstrap学习笔记(2)html中checkbox和radio

时间:2016-12-30 19:05:13      阅读:181      评论:0      收藏:0      [点我收藏+]

标签:head   name   label   html   boot   each   water   utf-8   并且   

checkbox复选,radio单选

 1 <!DOCTYPE html>
 2 <html lang="en">
 3 <head>
 4     <meta charset="UTF-8">
 5     <title>Document</title>
 6 </head>
 7 <body>
 8     <!-- 复选框跟文字联动,需要label标签包裹,并且label里的for是input的id -->
 9     <label for="apple"><input type="checkbox" id="apple">苹果</label>
10     <label for="banana"><input type="checkbox" id="banana">香蕉</label>
11     <label for="peach"><input type="checkbox" id="peach">桃子</label>
12     <br><br>
13     <!-- 单选框只让选一个,name里面用同一个名字就可以 -->
14     <label for="watermelon"><input type="radio" name="fruit" id="watermelon">西瓜</label>
15     <label for="pear"><input type="radio" name="fruit" id="pear">梨子</label>
16     <label for="orange"><input type="radio" name="fruit" id="orange">桔子</label>
17 </body>
18 </html>

 

Bootstrap学习笔记(2)html中checkbox和radio

标签:head   name   label   html   boot   each   water   utf-8   并且   

原文地址:http://www.cnblogs.com/Jacklovely/p/6237444.html

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