• CSS学习笔记(2)--html中checkbox和radio


    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>
  • 相关阅读:
    使用IDEA整合SSM框架
    宏任务与微任务
    setTimeout的实现及其问题
    JS的闭合(Closure)
    this详解
    JS的作用域和作用域链
    JS的执行上下文
    JS内存机制
    抽象工厂模式(c++实现)
    迭代器模式(c++实现)
  • 原文地址:https://www.cnblogs.com/Jacklovely/p/6237444.html
Copyright © 2020-2023  润新知