1_表单元素.html 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  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. <!-- <input type="text">
  10. <input type="password">
  11. <input type="button" value="提交">
  12. <button>按钮</button>
  13. <input type="checkbox" name="hobby">
  14. <input type="checkbox" name="hobby">
  15. <input type="checkbox" name="hobby">
  16. <input type="radio" name="sex" >男
  17. <input type="radio" name="sex" >女
  18. <select name="" id="">
  19. <option value="">黑大</option>
  20. <option value="">农大</option>
  21. <option value="">理工</option>
  22. </select> -->
  23. <form action="xxx.php">
  24. <input type="text" name="username" autofocus placeholder="请输入用户名">
  25. <input type="date" name="" id="dateval">
  26. <input type="color" name="" id="coloval">
  27. <input type="range" max="100" min="0" step="10" name="" id="rangeval">
  28. <input type="email" name="" id="">
  29. <input type="url" name="" id="">
  30. <button type="submit">提交</button>
  31. <button type="button" onclick="foo()" id="btn">按钮</button>
  32. <select name="" id="">
  33. <option value="">黑大</option>
  34. <option value="">农大</option>
  35. <option value="">理工</option>
  36. </select>
  37. <input list="test">
  38. <datalist id="test">
  39. <option value="黑大">黑大</option>
  40. <option value="理工">理工</option>
  41. <option value="黑工程">黑工程</option>
  42. </datalist>
  43. </form>
  44. <form action="" oninput="x.value = a.value + b.value">
  45. <input type="number" min="10" max="20" step="2" name="" id="">
  46. <input type="text" id="a">
  47. <input type="text" id="b">
  48. <output name="x" for="a b"></output>
  49. </form>
  50. <script>
  51. // var oBtn = document.getElementById("btn");
  52. var oDate = document.getElementById("dateval");
  53. var oColor = document.getElementById("coloval");
  54. var oRange = document.getElementById("rangeval")
  55. // oBtn.onclick =function(){
  56. // console.log(oDate.value)
  57. // }
  58. function foo(){
  59. console.log(oRange.value)
  60. }
  61. </script>
  62. </body>
  63. </html>