6_表单元素.html 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="UTF-8">
  5. <meta name="viewport" content="width=device-width, initial-scale=1.0">
  6. <title>Document</title>
  7. </head>
  8. <body>
  9. <!-- 表单元素(表单标签) -->
  10. <!-- 文本输入框 -->
  11. <input type="text">
  12. <!-- 密码输入框 -->
  13. <input type="password">
  14. <!-- 单选框 会根据name属性值来分组 -->
  15. <input type="radio" name="gender">男
  16. <input type="radio" name="gender">女
  17. <!-- 复选框 会根据name属性值来分组 -->
  18. <input type="checkbox" name="hobby">篮球
  19. <input type="checkbox" name="hobby">足球
  20. <input type="checkbox" name="hobby">排球
  21. <!-- 下拉列表 -->
  22. <select>
  23. <option>黑龙江</option>
  24. <option>吉林</option>
  25. <option>辽宁</option>
  26. </select>
  27. <!-- 多行文本输入框 文本域 rows 代表输入的行数 cols 代表输入的列数 -->
  28. <textarea rows="6" cols="30"></textarea>
  29. <!-- 按钮 -->
  30. <input type="button" value="按钮">
  31. <button>按钮</button>
  32. <!-- 上传按钮 -->
  33. <input type="file">
  34. </body>
  35. </html>