①将type类型设为"checkbox"
②name=""用来设置变量名
③value=""用来设置变量默认值
④<input>此处设置需要显示的内容<br>
 
代码示例:
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>html复选框</title>
</head>
<body>
    <form>
        <label>请选择你喜欢的水果:</label><br>
        <input type="checkbox" name="apple" value="苹果">苹果<br>
        <input type="checkbox" name="banana" value="香蕉">香蕉<br>
        <input type="checkbox" name="orange" value="橙子">橙子<br>
        <input type="checkbox" name="melon" value="西瓜">西瓜<br>
        <input type="submit">
    </form>
</body>
</html>

运行截图:

HTML复选框

 

 

相关文章:

  • 2021-06-03
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-04-07
  • 2021-12-02
猜你喜欢
  • 2022-12-23
  • 2021-10-13
  • 2021-07-06
  • 2022-12-23
  • 2022-02-18
  • 2021-08-11
  • 2022-01-21
相关资源
相似解决方案