7_表单元素.html 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="UTF-8">
  5. <meta http-equiv="X-UA-Compatible" content="IE=edge">
  6. <meta name="viewport" content="width=device-width, initial-scale=1.0">
  7. <title>Document</title>
  8. </head>
  9. <body>
  10. <!-- 表单 action提交地址-->
  11. <form action="xxx">
  12. <!-- 文本框 type="text"-->
  13. 用户名:<input type="text">
  14. <!-- 密码框 type="password"-->
  15. 密码:<input type="password">
  16. <br>
  17. <!-- 单选框 type="radio" 需要有一个相同的name属性,代表他们是一组的-->
  18. 性别:
  19. <input type="radio" name="sex">男
  20. <input type="radio" name="sex">女
  21. <br>
  22. <!-- 复选框 type="checkbox" -->
  23. 爱好:
  24. <input type="checkbox" name="hobby">吃饭
  25. <input type="checkbox" name="hobby">睡觉
  26. <input type="checkbox" name="hobby">敲代码
  27. <br>
  28. <!-- 下拉框 -->
  29. <select>
  30. <option>黑大</option>
  31. <option>理工</option>
  32. <option>林大</option>
  33. </select>
  34. <br>
  35. <!-- 文本域 -->
  36. <textarea></textarea>
  37. <br>
  38. <!-- 普通按钮 -->
  39. <button>按钮</button>
  40. <!-- type="submit" 提交按钮 -->
  41. <input type="submit">
  42. <!-- type="reset" 重置按钮 -->
  43. <input type="reset">
  44. </form>
  45. </body>
  46. </html>