3_输入类型.html 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  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. <form action="">
  11. text: <input type="text"> <br>
  12. email: <input type="email"><br>
  13. <!--
  14. type: email
  15. 会对输入的内容进行一个邮箱格式的校验
  16. 必须要包含 @
  17. @ 后面要有内容
  18. -->
  19. color: <input type="color"><br>
  20. <!--
  21. type: color
  22. 调色板
  23. -->
  24. date: <input type="date"><br>
  25. <!--
  26. type: date
  27. 日历功能 带有自己的样式
  28. -->
  29. time: <input type="time"><br>
  30. <!--
  31. type: time
  32. 时间功能
  33. -->
  34. range: <input type="range"><br>
  35. range: <input type="range" step="20"><br>
  36. <!--
  37. type: range
  38. 滑块类型
  39. setp属性 定义每一次滑动的距离
  40. -->
  41. search: <input type="search"><br>
  42. <!--
  43. type: search
  44. 输入框可以输入内容 但是带有自己的清除按键
  45. -->
  46. number: <input type="number" max="20" min="9" step="2"> <br>
  47. <!--
  48. type: number
  49. 如果超出有效值 默认调整为最近的有效值
  50. -->
  51. tel: <input type="tel" maxlength="11"><br>
  52. <!--
  53. type: tel
  54. maxlength 输入的最大长度
  55. 在手机端会默认唤醒拨号键盘
  56. -->
  57. file: <input type="file" accept="image/png"><br>
  58. <!--
  59. type: file
  60. 上传文件
  61. accept 设置选择文件的类型
  62. -->
  63. <select name="" id="">
  64. <option value="xx">1</option>
  65. <option value="aa">2</option>
  66. </select>
  67. <input type="text" list="list1">
  68. <datalist id="list1">
  69. <option value="xiaoming" label="zhang">xiaoming</option>
  70. <option value="xiaohong">xiaohong</option>
  71. <option value="xiaoming" label="wang">xiaoming</option>
  72. </datalist>
  73. <br>
  74. <input type="submit">
  75. </form>
  76. </body>
  77. </html>