1.表单标签.html 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  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. 表单 form
  11. 属性 action 将表单中的数据提交到服务端上(一般不用)
  12. 输入框 input 行内块元素
  13. 属性
  14. placeholder 提示信息 并不会影响输入框的使用
  15. type:
  16. text 输入框
  17. password 密码
  18. submit 提交按钮
  19. reset 重置按钮
  20. button 自定义按钮; value 自定义内容
  21. radio 单选; name名称相同
  22. checkbox 多选; checked 默认选中; disabled 禁止选中
  23. -->
  24. <form action="">
  25. <input type="text" placeholder="请输入您的用户名">
  26. <br>
  27. <input type="password" placeholder="请输入密码">
  28. <br>
  29. <input type="submit">
  30. <input type="reset">
  31. <input type="button" value="自定义">
  32. <br>
  33. <input name="aaa" type="radio">男
  34. <input name="aaa" type="radio">女
  35. <br>
  36. <input type="checkbox">篮球
  37. <input type="checkbox" checked>足球
  38. <input type="checkbox" disabled>排球
  39. <input type="checkbox">台球
  40. <br>
  41. <!--
  42. 下拉框
  43. select 与 option 一起组成
  44. 默认选择 selected
  45. 禁止选中 disabled
  46. -->
  47. <select>
  48. <option value="1">小学</option>
  49. <option value="2" selected>初中</option>
  50. <option value="3" disabled>高中</option>
  51. <option value="4">大学</option>
  52. </select>
  53. <!--
  54. 文本域
  55. textarea
  56. rows 行
  57. clos 列
  58. maxlength 最大输入长度
  59. -->
  60. <textarea rows="10" cols="30" maxlength="10"></textarea>
  61. </form>
  62. </body>
  63. </html>