- <form> 標簽
- 用于為用戶輸入創建 HTML 表單
- 表單能夠包含 input 元素,比如:文本欄位、復選框、單選框、提交按鈕等等
- 表單用于向服務器傳輸資料
- action 屬性:規定當提交表單時向何處發送表單資料
- method 屬性:規定用于發送 form-data 的 HTTP 方法
<form> <p>username<input type="text" name="username" id="uid" value="" /></p> <p>password<input type="text" name="password" id="pid" value="" /></p> <input type="button" value="button"> <input type="submit" value="submit" /> <input type="reset" name="" id="" value="reset" /> </form>
- radio 單選
- checked="" 屬性:默認選中
- name 屬性:設定或回傳單選按鈕的名稱
- type 屬性:型別
- value 屬性:單選按鈕的 value 屬性的值
<body> <form> <table border="1" width="200" height="30"> <tr> <td> <input type="radio" checked="" name="sex" id="boy" value="0"> <label for="boy">男</label> <input type="radio" name="sex" id="girl" value="1"> <label for="girl">女</label> <input type="radio" name="sex" id="secret" value="2"> <label for="secret">保密</label> </td> </tr> </table> </form> </body>
- checkbox 復選框
<body> <form> <table border="1" width="300" height="30"> <tr> <td colspan="3" align="center"> <label><input name="subject" id="p" type="checkbox" value="0" />Python </label> <label><input name="subject" id="j" type="checkbox" value="1" />Java </label> <label><input name="subject" id="h" type="checkbox" value="2" />Html </label> <label><input name="subject" id="g" type="checkbox" value="3" />Go </label> </td> </tr> </table> </form> </body>
- select 下拉框
<body> <form> <table border="1" width="100" height="30"> <tr> <td colspan="3"> <select id="school" value="dcs"> <option value="1">多測驗深圳校區</option> <option value="2">多測驗廣州校區</option> <option value="3">多測驗上海校區</option> <option value="4">多測驗北京校區</option> <option value="5">多測驗天津校區</option> </select> </td> </tr> </table> </form> </body>
- file 上傳檔案
<body> <form> <table border="1" width="100" height="30"> <tr> <td colspan="3"> <input type="file" /> </td> </tr> </table> </form> </body>
轉載請註明出處,本文鏈接:https://www.uj5u.com/qiye/58549.html
標籤:Html/Css
上一篇:HTML(表格標簽)
下一篇:仿美團外賣-首頁實作
