亚洲国产日韩欧美一区二区三区,精品亚洲国产成人av在线,国产99视频精品免视看7,99国产精品久久久久久久成人热,欧美日韩亚洲国产综合乱

搜索
博主信息
博文 145
粉絲 7
評論 7
訪問量 198514
最新下載
更多>
網(wǎng)站特效
網(wǎng)站源碼
網(wǎng)站素材
前端模板
html5表單相關(guān)(input、fieldset分組、textarea、seclect預(yù)定義列表)知識點(diǎn)案例演示
李東亞1??3????12?
原創(chuàng)
1016人瀏覽過

作業(yè)一:實(shí)操部分

1、代碼練習(xí)和演示

  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>表單相關(guān)</title>
  7. <style>
  8. form {
  9. width: 400px;
  10. /* height: 400px; */
  11. padding: 20px;
  12. margin: auto;
  13. background-color: #0ad4b9;
  14. display: grid;
  15. grid-gap: 15px;
  16. }
  17. form:hover {
  18. box-shadow: 0 0 3px #616161;
  19. }
  20. h2 {
  21. width: 400px;
  22. margin: auto;
  23. text-align: center;
  24. }
  25. section {
  26. display: grid;
  27. grid-template-columns: 80px 1fr;
  28. }
  29. section:last-child {
  30. display: grid;
  31. grid-template-columns: 1fr 1fr;
  32. }
  33. button {
  34. height: 30px;
  35. width: 60px;
  36. border: none;
  37. outline: none;
  38. background-color: lightblue;
  39. margin: auto;
  40. }
  41. button:hover {
  42. background-color: red;
  43. color: white;
  44. }
  45. fieldset > .other {
  46. display: grid;
  47. grid-template-columns: 80px repeat(6, 1fr);
  48. }
  49. legend {
  50. text-align: center;
  51. }
  52. textarea {
  53. width: 300px;
  54. }
  55. </style>
  56. </head>
  57. <body>
  58. <h2>用戶登陸</h2>
  59. <form action="login.php" method="POST">
  60. <section>
  61. <label for="username">用戶名:</label>
  62. <input
  63. type="text"
  64. id="username"
  65. name="username"
  66. placeholder="用戶名"
  67. required
  68. autofocus
  69. />
  70. </section>
  71. <section>
  72. <label for="pwd">密&nbsp;&nbsp;&nbsp;碼:</label>
  73. <input
  74. type="password"
  75. id="pwd"
  76. name="password"
  77. placeholder="不少于6位密碼"
  78. required
  79. />
  80. </section>
  81. <section>
  82. <button type="submit">登陸</button>
  83. <button type="reset">重置</button>
  84. </section>
  85. </form>
  86. <hr />
  87. <h2>用戶注冊</h2>
  88. <form action="" enctype="multipart/form-data">
  89. <fieldset>
  90. <legend>基本信息</legend>
  91. <section>
  92. <label for="username">用戶名:</label>
  93. <input
  94. type="text"
  95. id="username"
  96. name="username"
  97. placeholder="用戶名"
  98. required
  99. />
  100. </section>
  101. <section>
  102. <label for="pwd">密&nbsp;&nbsp;&nbsp;碼:</label>
  103. <input
  104. type="password"
  105. id="pwd"
  106. name="password"
  107. placeholder="不少于6位密碼"
  108. required
  109. />
  110. </section>
  111. <section class="other">
  112. <label for="">性別:</label>
  113. <input type="radio" name="sex" value="1" />
  114. <input type="radio" name="sex" value="0" checked />
  115. <input type="radio" name="sex" value="2" />保密
  116. </section>
  117. </fieldset>
  118. <fieldset>
  119. <legend>德智體美</legend>
  120. <section class="other">
  121. <label for="">愛好:</label>
  122. <input type="checkbox" name="like[]" value="" checked />跑步
  123. <input type="checkbox" name="like[]" value="" checked />游泳
  124. <input type="checkbox" name="like[]" value="" />玩游戲
  125. </section>
  126. <section>
  127. <label for="">特長</label>
  128. <input type="text" list="course" name="course" />
  129. <datalist id="course">
  130. <option value="html">html</option>
  131. <option value="css">css</option>
  132. <option value="javascript">javascript</option>
  133. </datalist>
  134. </section>
  135. <section>
  136. <label for="php">科目</label>
  137. <select name="php" id="php">
  138. <optgroup label="前端">
  139. <option value="html">html</option>
  140. <option value="css">css</option>
  141. <option value="javascript">javascript</option>
  142. </optgroup>
  143. <optgroup label="后端">
  144. <option value="php" label="php"></option>
  145. <option value="composer" label="composer" selected></option>
  146. <option value="laravel">laravel</option>
  147. </optgroup>
  148. </select>
  149. </section>
  150. <section>
  151. <label for="">頭像:</label>
  152. <input type="hidden" name="MAX_FILE_SIZE" value="800000" />
  153. <input type="file" name="" id="" />
  154. </section>
  155. <section>
  156. <label for="">圖片域:</label>
  157. <input type="image" src="dy.png" width="80px" height="30px" />
  158. </section>
  159. <section>
  160. <h4>個(gè)人介紹</h4>
  161. <textarea
  162. name=""
  163. id=""
  164. cols=""
  165. rows="10"
  166. placeholder="自我介紹……"
  167. ></textarea>
  168. </section>
  169. </fieldset>
  170. <section>
  171. <button
  172. type="submit"
  173. formaction="login"
  174. formmethod="POSt"
  175. formtarget="_blank"
  176. >
  177. 登陸
  178. </button>
  179. <button type="submit" formaction="">發(fā)送</button>
  180. </section>
  181. </form>
  182. </body>
  183. </html>

2、代碼運(yùn)行結(jié)果圖

作業(yè):總結(jié)

1、相關(guān)知識總結(jié)
1、表單相關(guān)常見標(biāo)簽:
表單:<form></form>
控件:<label></label><input/>、
按鈕:<botton></botton>、
自定義列表:<select><optgroup label="分組"><option>自定義列表項(xiàng)<option/><optgroup></select>、
預(yù)定義輸入:<input list="course"/><datalist id="course"> <option>預(yù)定義選項(xiàng)</option></datalist>
分組標(biāo)簽:<fieldset></fieldset><legend></legend>
2、表單相關(guān)屬性:
a、form: action=”請求處理地址”,method=”請求發(fā)送方式(GET|POST)”,target=”打開方式(_blank)” ,name=”表單名稱”,enctype=”application/x-www-form-urlencoded | multipart/form-data”
b、input: type=”控件類型見c項(xiàng)”、name=”空間名字”,value=”控件值”,form=”空間所屬表單”,placeholder=”提示信息占位符(text和password)”, autofocus:自動(dòng)獲取焦點(diǎn),checked:默認(rèn)選項(xiàng)(radio和checkbox)等等
c、input空間類型:text password radio checkbox file image hidden email data和datatime-local tel url number range(范圍拖動(dòng)條) search color等
d、button type=”submit|reset|button”,name=”名字”,value=”按鈕文本值”,form相關(guān)屬性:formaction和form……
e、select : name=”請求參數(shù)名稱”,multiple:是否多選(布爾值) size=”允許顯示的列表數(shù)量”
3、表單相關(guān)事件:

序號 事件屬性 描述
1 onfocus 獲取焦點(diǎn)時(shí)觸發(fā)
2 onblur 失去焦點(diǎn)時(shí)觸發(fā)
3 onchange 失去焦點(diǎn),且值發(fā)生變化時(shí)觸發(fā)
4 oninput 值發(fā)生變化(不等失去焦點(diǎn))時(shí)觸發(fā)
5 onkeydown 按下鍵盤時(shí)觸發(fā)
6 onkeyup 抬起鍵盤時(shí)觸發(fā)
7 onclick 鼠標(biāo)單擊時(shí)觸發(fā)
8 onselect 選擇內(nèi)容文本時(shí)觸發(fā)
批改老師:天蓬老師天蓬老師

批改狀態(tài):合格

老師批語:你的總結(jié)就是知識的羅列, 沒有多大意義 , 沒有個(gè)人主觀意見, 下次注意
本博文版權(quán)歸博主所有,轉(zhuǎn)載請注明地址!如有侵權(quán)、違法,請聯(lián)系admin@php.cn舉報(bào)處理!
全部評論 文明上網(wǎng)理性發(fā)言,請遵守新聞評論服務(wù)協(xié)議
0條評論
關(guān)于我們 免責(zé)申明 意見反饋 講師合作 廣告合作 最新更新
php中文網(wǎng):公益在線php培訓(xùn),幫助PHP學(xué)習(xí)者快速成長!
關(guān)注服務(wù)號 技術(shù)交流群
PHP中文網(wǎng)訂閱號
每天精選資源文章推送
PHP中文網(wǎng)APP
隨時(shí)隨地碎片化學(xué)習(xí)
PHP中文網(wǎng)抖音號
發(fā)現(xiàn)有趣的

Copyright 2014-2025 http://ipnx.cn/ All Rights Reserved | php.cn | 湘ICP備2023035733號

  • 登錄PHP中文網(wǎng),和優(yōu)秀的人一起學(xué)習(xí)!
    全站2000+教程免費(fèi)學(xué)