html常用表單元素(組件)


html常用表單元素(組件):

語法: <input type = ?/> 總共有10種,另外兩種為文本域textarea,下拉列表選擇框 select

問號代表的有以下十種:
  1. 文本框(默認——如果沒有指定type,默認顯示文本框)
   text 語法<input />
  2.密碼框——password
  3.單選按鈕——radio
  4.復選框——checkbox
  5.普通按鈕——button
  6.提交按鈕——submit
  7.重置按鈕——reset
  8.文件域——file
  9.圖像域——image
  10.隱藏域——hidden

 

 1      文本框:<input type="text" /><br />    
 2         密碼框:<input type="password" /><br />
 3         
 4         單選按鈕:<input type="radio" name="sex"/> 5                 <input type="radio" name="sex"/><br />
 6                 
 7         復選按鈕:<input type="checkbox" name="hobby" />唱歌  8                 <input type="checkbox" name="hobby"/>跳舞  9                 <input type="checkbox" name="hobby"/>代碼<br />
10                 
11         普通按鈕:<input type="button" value="普通按鈕"/><br />
12         提交按鈕:<input type="submit" value="登陸" /><br />
13         重置按鈕:<input type="reset" value="清空"/><br />
14         
15         文件域:    <input type="file" name="file1"/><br />
16         影像域:    <input type="image" src="../img/btn.jpg"/ width="192" height="120"><br />
17         隱藏域:    <input type="hidden" name="userId"/><br />
18         
19         文本域:    <textarea cols="50" rows="10">
20  請您輸入觀看《伴我同行》的感想 :) 21         </textarea><br />
22         
23         下拉列表選擇框:<select>
24             <option>---請輸入所在的城市---</option>
25             <option>北京</option>
26             <option>上海</option>
27             <option>廣州</option>
28             <option>深圳</option>
29             <option>天津</option>
30         </select>

 

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM